Different kinds of search
There are two opinionated, prebuild search strategies. You can overwrite retrieval with a closure if you want more customization. There is also some work being done on a custom strategy, which takes the query builder from a storage provider, but this has not been implemented yet for all.
Similarity Single Embedding
This is the default strategy.
Similarity single embedding does a vector similarity search. The strategy expects the query to have an embedding set.
Hybrid Search
Search with different kinds of search in the same database, automatically rerank if supported, and return the top matching documents.
For Qdrant, the strategy expects both a dense and a sparse vector to be present. Sparse vectors can be generated with integrations::fastembed::FastEmbed
.
Additional configuration is also possible on the strategy itself.
Creating a pipeline with a strategy
To create a query pipeline from a search strategy, you can use the query::Pipeline::from_search_strategy
constructor, like this: