lerouxrgd / ngt-rs

Rust wrappers for NGT approximate nearest neighbor search
Apache License 2.0
36 stars 6 forks source link

How to reconstruct ANNG? #3

Closed nyapicom closed 2 years ago

nyapicom commented 2 years ago

I guess ngt::optim::refine_anng is the one, but I don't know how to use it... I tried to put ngt::optim::AnngRefineParams::default() into the second argument but the system crushed.

lerouxrgd commented 2 years ago

There is a unit test that uses it:

https://github.com/lerouxrgd/ngt-rs/blob/4dd6fdf1fb15f2fd4a29a952e2b54b81d3146fe8/src/optim.rs#L348-L369

You need to build the index beforehand. Does it help ? Otherwise can you make an example to reproduce the crash ?

Note that you cannot use shared_mem feature with refine_anng but the function should not be available if you use this feature.

lerouxrgd commented 2 years ago

How to reconstruct ANNG

Do you mean ANNG to reconstruct ONNG ?

In this case, the function to use is convert_anng_to_onng. Note that you need to optimize the index in a very specific way, as described in the NGT documentation.

nyapicom commented 2 years ago

it worked well. Thank you for your help.