if query_model_id is used, do not provide an embedding function.
Parameters
query_model_id – Optional. ID of the model to use to
embed the query text within the stack. Requires
embedding model to be deployed to Elasticsearch.
hybrid – Optional. If True, will perform a hybrid search
using both the knn query and a text query.
Defaults to False.
rrf – Optional. rrf is Reciprocal Rank Fusion.
When hybrid is True,
and rrf is True, then rrf: {}.
and rrf is False, then rrf is omitted.
and isinstance(rrf, dict) is True, then pass in the dict values.
rrf could be passed for adjusting ‘rank_constant’ and ‘window_size’.
static ExactRetrievalStrategy() → ExactRetrievalStrategy[source]¶
Used to perform brute force / exact
nearest neighbor search via script_score.
static SparseVectorRetrievalStrategy(model_id: Optional[str] = None) → SparseRetrievalStrategy[source]¶
Used to perform sparse vector search via text_expansion.
Used for when you want to use ELSER model to perform document search.
At build index time, this strategy will create a pipeline that
will embed the text using the ELSER model and store the
resulting tokens in the index.
At query time, the text will be embedded using the ELSER
model and the resulting tokens will be used to
perform a text_expansion query.
Parameters
model_id – Optional. Default is “.elser_model_1”.
ID of the model to use to embed the query text
within the stack. Requires embedding model to be
deployed to Elasticsearch.