Unlimited vector search by Certainty #1883
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Recursively searches the HNSW index for vectors above a specified certainty, increasing the size of the search with each iteration
Notes
Max Query Limit
This recursive search has a configurable max limit. If the call originates directly from the client (i.e. from a
Get
query), the search is limited by the configuredQUERY_MAXIMUM_RESULTS
. However if the call is invoked internally (i.e. by an aggregation process), a maximum limit is not imposed.The reason for this is that every id found in the HNSW index for a
Get
query will be eventually used to fetch an object. If there was no upper bound to this example, the entire vector index could be converted into objects, which would be extremely resource intensive.An aggregation does not need an object per id, and therefore does not suffer from the same issue.
Triggering Search By Certainty
Currently, a client searches trigger the unlimited search with a
Get
query by:certainty
with a near vector search without providing alimit
certainty
with a near vector search and passing alimit
of-1