search_query.query
Query class.
Classes
|
Query class. |
- class search_query.query.Query(value: str, *, operator: bool = True, search_field: SearchField | None = None, children: List[str | Query] | None = None, position: Tuple[int, int] | None = None, platform: str = 'generic')
Bases:
object
Query class.
- classmethod create(value: str, *, operator: bool = True, search_field: SearchField | None = None, children: List[str | Query] | None = None, position: Tuple[int, int] | None = None, platform: str = 'generic', distance: int = 0) Query
Factory method for query creation.
- evaluate(records_dict: dict) dict
Evaluate the query against records using colrev_status labels.
rev_included: relevant
rev_excluded / rev_prescreen_excluded: irrelevant
others: ignored
- get_nr_leaves() int
Returns the number of leaves in the query tree
- is_term() bool
Check whether the SearchQuery is a term.
- property operator: bool
Operator property.
- property platform: str
Platform property.
- replace(new_query) None
- property search_field: SearchField | None
Search field property.
- selects(*, record_dict: dict) bool
Indicates whether the query selects a given record.
- selects_record(record_dict: dict) bool
Abstract method to be implemented by subclasses to select records.
- set_platform_unchecked(platform: str, silent: bool = False) None
Set the platform for this query node without validation. This is an optional utility for parsers.
- to_generic_string() str
Prints the query in generic syntax
- to_string() str
Prints the query as a string
- to_structured_string() str
Prints the query in generic syntax
- translate(target_syntax: str) Query
Translate the query to the target syntax using the provided translator.
- property value: str
Value property.