QueryMixin

QueryMixin()
A mixin class that provides query execution capabilities for classes that include it. This class sets up the necessary infrastructure to execute queries on a set of indices using a storage manager.

Descendants

Methods

async_query()

async_query(query_descriptor, **params) -> QueryResult
Execute a query asynchronously using the provided QueryDescriptor and additional parameters.
query_descriptor
QueryDescriptor
required
The query object containing the query details.
**params
Any
required
Additional parameters for the query execution.
Returns: QueryResult - The result of the asynchronous query execution.

query()

query(query_descriptor, **params) -> QueryResult
Execute a query using the provided QueryDescriptor and additional parameters.
query_descriptor
QueryDescriptor
required
The query object containing the query details.
**params
Any
required
Additional parameters for the query execution.
Returns: QueryResult - The result of the query execution. Raises: InvalidInputException - If the query index is not found among the executor’s indices.

setup_query_execution()

setup_query_execution(indices) -> None
Set up the query execution environment by initializing a mapping between indices and their corresponding QueryVectorFactory instances.
indices
Sequence[Index]
required
A sequence of Index instances to be used for query execution.

setup_query_result_converter()

setup_query_result_converter(query_result_converter) -> None
Set up the query result converter to be used for converting the query results.
query_result_converter
QueryResultConverter
required
The query result converter instance.