search.dsl
Classes
Extends elastichsearch_dsl's search object with ORM integration. |
|
Extends the default response (list of results) with additional |
|
Extends a single result with additional methods to query the SQLAlchemy |
|
Extends the default response (list of results) with additional |
Functions
|
|
|
Gets the value from the explanation for descriptions starting with |
Module Contents
- class search.dsl.Search(*args: Any, **kwargs: Any)[source]
Bases:
elasticsearch_dsl.Search
Extends elastichsearch_dsl’s search object with ORM integration.
Works exactly the same as the original, but the results it returns offer additional methods to query the SQLAlchemy models behind the results (if any).
- class search.dsl.Response(search, response, doc_class=None)[source]
Bases:
elasticsearch_dsl.response.Response
Extends the default response (list of results) with additional methods to query the SQLAlchemy models behind the results.
- classmethod bind(session: Session | None, mappings: TypeMappingRegistry | None, explain: bool) type[Response.bind.BoundResponse] [source]
- query(type: str) Query[Any] | None [source]
Returns an SQLAlchemy query for the given type. You must provide a type, because a query can’t consist of multiple unrelated tables.
If no results match the type, None is returned.
- load() list[Any] [source]
Loads all results by querying the SQLAlchemy session in the order they were returned by elasticsearch.
Note that the resulting lists may include None values, since we are might get elasticsearch results for which we do not have a model on the database (the data is then out of sync).
- search.dsl.explanation_value(explanation: Any, text: str) dict[str, Any] | None [source]
Gets the value from the explanation for descriptions starting with the given text.
- class search.dsl.Hit(document)[source]
Bases:
elasticsearch_dsl.response.Hit
Extends a single result with additional methods to query the SQLAlchemy models behind the results.