Search
Source code in ftmq/search/store/__init__.py
FilterTerm
dataclass
One search-index predicate: field holds any of values - or none of
them, if negated. The terms of a query AND together.
Source code in ftmq/search/store/base.py
get_filters(query)
Compile a query's filter tree into the flat term list a search index can apply.
The index holds three filterable fields (datasets, schema,
countries); a filter on anything else is dropped. A not / not_in
comparator (or a ~ around a single condition) becomes a negated term
instead of being read as a positive one, and a shape that cannot be
expressed as ANDed terms - a cross-field OR, a negated group, a comparator
like ilike on an indexed field - raises.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
Query | None
|
The query to compile ( |
required |
Returns:
| Type | Description |
|---|---|
list[FilterTerm]
|
The terms to AND together. |
Raises:
| Type | Description |
|---|---|
QueryError
|
If the query's filter tree is not expressible. |