QueryResult#
- class scikitplot.corpus.QueryResult(documents, total, query, filter_support=<factory>)[source]#
Result container returned by
StorageBase.query.- Parameters:
- documentslist[CorpusDocument]
Page of results matching the query.
- totalint
Total number of matching documents (before
limit/offset).- queryStorageQuery
The query that produced this result (for traceability).
- filter_supportdict[str, FilterSupport], optional
Per-filter account of how each requested filter was handled. Filters the caller did not set do not appear.
- Parameters:
documents (list[CorpusDocument])
total (int)
query (StorageQuery)
Notes
Developer.
filter_supportis a required part of the result rather than an optional courtesy, so a backend cannot quietly drop a filter it does not implement (ADR-R07-002).Examples
>>> # a caller can assert the filter actually ran >>> # result.filter_support["full_text"] is FilterSupport.EMULATED
- documents: list[CorpusDocument][source]#
- property emulated_filters: list[str]#
Names of filters answered by a fallback path rather than natively.
- query: StorageQuery[source]#
- require_native()[source]#
Raise if any requested filter was emulated rather than native.
- Raises:
- RuntimeError
If any filter reports
FilterSupport.EMULATED.
- Return type:
None
Notes
User. Call this when emulation is not acceptable – for example when comparing ranking quality across backends, where a substring scan and an FTS5 index are not interchangeable.