Skip to content

Optionally Allow Fewer Than Requested Neighbors to Be Returned #111

Description

@tcheath

In some circumstances, it would be desirable that when you ask for k nearest neighbors from the index and fewer than k are found, that however many are found are returned and the RecallError at the line below (and a similar one later in the file) would be suppressed.

if (result.size() != (unsigned long)k) {
throw RecallError(
"Fewer than expected results were retrieved; only found " +
std::to_string(result.size()) + " of " + std::to_string(k) +
" requested neighbors. Reconstruct the index with a higher M "
"value to increase recall.");
}

It could be flag in either the index construction or the query args.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions