Skip to main content
Pinecone Docs

Search documentation

Type to search this documentation.

On this pageOverview

Limitations of querying by ID

Understand why querying by record ID can omit that ID under ANN search, and when to use fetch or metadata filters to retrieve a specific vector reliably.

When querying by record ID, even with a high topK, the response isn't guaranteed to include the record with the specified ID.

Approximate nearest neighbor algorithms are designed to quickly find the closest matches to a given data point within large datasets with reasonable accuracy rather than perfect precision. Depending on the data, ANN may have a slightly lower accuracy than Known Nearest Neighbor (KNN) algorithms, but will have significantly lower read costs and latency than KNN. This is one of the key features of ANN.

ANN algorithms assess broad data clusters to find matches. Some of these clusters might be ignored even if they contain relevant records simply because their overall similarity to the query is lower, because the algorithm aims to optimize the search by focusing on areas with a higher density of potential matches.

See our learning center for more information on ANN algorithms.

Results from Fetch are guaranteed to include the record with the specified ID.

A metadata filter in an ANN search effectively narrows the dataset to a more relevant subset, fine-tuning the search process. By explicitly excluding less relevant clusters from the outset, the search is performed among a group of records more closely related to the query, thereby increasing the efficiency and accuracy of the search.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu