yahoojapan / NGT

Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data
Apache License 2.0
1.24k stars 114 forks source link

Quantized ONNG: is search radius supported ? #114

Closed fonspa closed 2 years ago

fonspa commented 2 years ago

Hi,

I'm exploring the performance of a quantized ONNG index and I'd like to try with a search radius around the query point, which is possible with a ANNG index, via the Python binding or via the ngt CLI tool.
But the search_radius parameter is unavailable in the Python binding for the search method of QuantizedIndex, and isn't listed in the possible parameters for the ngtqg search CLI tool.
However, it's apparently still possible to pass -r to the ngtqg search tool to pass a search radius even if it's not documented, but I get only zeros for the IDs of every query, which is unreasonable, as the index has a good recall on my data with the epsilon and result_expansion I provide. Do you have an idea why ? Could you confirm that passing a search radius is possible via the CLI tool for a quantized ONNG index and if so, would it be possible to add the parameter to the QuantizedIndex.search method in the Python binding ?
Thanks a lot!

masajiro commented 2 years ago

I reproduced the situation you mentioned. ngtqg was basically supposed not to support range queries, however, now I will implement the range queries to ngtqg in the near future.

fonspa commented 2 years ago

That's great news, thank you for your update. I'll try the range search on a quantized onng again when it's available, thanks!

masajiro commented 2 years ago

I have just made a new release v1.14.3 with this bug fix of the range queries.

fonspa commented 2 years ago

I'll try the new release ASAP and close the issue if it works fine. Thanks a lot for your work.

masajiro commented 2 years ago

I closed this issue for now. Feel free to reopen this whenever you find any issue.