Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add range_search() to IndexRefine #4022

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexanderguzhva
Copy link
Contributor

@alexanderguzhva alexanderguzhva commented Nov 8, 2024

This is very convenient to have range_seach() in IndexRefine. Unlike the plain search() method, range_search() just reevaluates the computed distances from the baseline index. The labels are not re-sorted according to new distances, because this is not listed as a requirement in a method description

faiss/faiss/Index.h

Lines 150 to 161 in adb1884

/** query n vectors of dimension d to the index.
*
* return all vectors with distance < radius. Note that many
* indexes do not implement the range_search (only the k-NN search
* is mandatory).
*
* @param n number of vectors
* @param x input vectors to search, size n * d
* @param radius search radius
* @param result result table
*/
virtual void range_search(

float* distances; ///< corresponding distances (not sorted)

Signed-off-by: Alexandr Guzhva <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants