pybool_ir.query.ast#

Base classes for representing queries.

The OperatorNode class represents a query that is a combination of other queries. It can be used to represent a query that is a combination of other queries, such as a Boolean query.

The AtomNode class represents a query that is a single query. It can be used to represent a query, such as a term query.

Classes

ASTNode()

AtomNode(query, field)

Represents a query that is a single query.

OperatorNode(operator, children)

Represents a query that is a combination of other queries.

class pybool_ir.query.ast.AtomNode(query: str, field: List[str] | str)#

Bases: ASTNode

Represents a query that is a single query.

field: List[str] | str#

The field or fields that the query is applied to in the index.

query: str#

The actual string of the query.

class pybool_ir.query.ast.OperatorNode(operator: str, children: List[ASTNode])#

Bases: ASTNode

Represents a query that is a combination of other queries.

children: List[ASTNode]#

The children of the node.

operator: str#

The relationship expressed between the children, e.g., AND, OR, NOT.