- Semantic text search
- Recommendation systems
- Similar item discovery
- Retrieval-Augmented Generation (RAG)
- Image similarity
- Audio matching
Search parameters
Configure search behavior with the following parameters:
Adjust parameters based on your accuracy and speed requirements. Request only the data you need to minimize response size and network overhead.
Search results
Each search result contains the following components:Always included
id: Vector identifier as an integer.score: Similarity measure as a float.
Conditionally included
payload: Metadata dictionary whenwith_payload=True.vector: Embedding array whenwith_vectors=True.
Understanding scores
Score interpretation varies by distance metric:- Cosine similarity uses higher scores to indicate greater similarity, with a range of negative one to one.
- Euclidean distance uses lower scores to indicate greater similarity, with a range of zero to infinity.
- Dot product uses higher scores to indicate greater similarity, with a range of negative infinity to positive infinity.
Search performance optimization
Several strategies improve search performance and reduce latency.Use filters effectively
Filters reduce the search space before similarity computation:- Apply restrictive filters to limit candidates.
- Combine multiple conditions strategically.
- Index frequently filtered fields for faster evaluation.
Control result size
Request only the data you need:- Set
limitto the minimum number of results required. - Set
with_payload=Falsewhen metadata is unnecessary. - Set
with_vectors=Falseunless raw embeddings are needed.
Tune HNSW parameters
Balance accuracy and speed with theef parameter. Lower ef values provide faster search with reduced accuracy. Higher ef values provide better accuracy with increased latency. The default provides balanced performance for most use cases.
Test different ef values with your data to find the optimal setting for your accuracy requirements.
Batch searches
For multiple queries, batch them together when possible. Batching reduces network round trips, improves overall throughput, and optimizes resource utilization. This is especially effective when processing many queries in sequence.Task guides
The following guides cover search operations step by step.Next steps
- Filtering — Apply must, should, and must-not conditions to search.
- Distance metrics — Understand how scores are calculated.
- Indexing — Tune HNSW parameters for search performance.
- Points — Manage the data being searched.