QueryExecutor provides an interface to execute predefined queries with query time parameters.

Constructor

QueryExecutor(app, query_descriptor, query_vector_factory)

Parameters

app
App
required
An instance of the App class.
query_descriptor
QueryDescriptor
required
An instance of the QueryDescriptor class representing the query to be executed.
query_vector_factory
QueryVectorFactory
required
An instance of the QueryVectorFactory class used to produce query vectors.

Methods

query()

query(**params) -> QueryResult
Execute a query with keyword parameters.
**params
Sequence[str] | Sequence[float] | PIL.Image.Image | str | int | float | bool | tuple[str | None, str | None] | None
required
Arbitrary arguments with keys corresponding to the name attribute of the Param instance.
Returns: The result of the query execution that can be inspected and post-processed. Raises: InvalidInputException - If the query index is not amongst the executor’s indices.