pandagg.node.query.compound module

class pandagg.node.query.compound.Bool(*args, **kwargs)[source]

Bases: pandagg.node.query.compound.CompoundClause

DEFAULT_OPERATOR

alias of pandagg.node.query._parameter_clause.Must

KEY = 'bool'
PARAMS_WHITELIST = ['should', 'must', 'must_not', 'filter', 'boost', 'minimum_should_match']
class pandagg.node.query.compound.Boosting(*args, **kwargs)[source]

Bases: pandagg.node.query.compound.CompoundClause

DEFAULT_OPERATOR

alias of pandagg.node.query._parameter_clause.Positive

KEY = 'boosting'
PARAMS_WHITELIST = ['positive', 'negative', 'negative_boost']
class pandagg.node.query.compound.CompoundClause(*args, **kwargs)[source]

Bases: pandagg.node.query.abstract.QueryClause

Compound clauses can encapsulate other query clauses.

Note: the children attribute’s only purpose is for initiation with the following syntax: >>> from pandagg.query import Bool, Term >>> query = Bool( >>> filter=Term(field=’some_path’, value=3), >>> _name=’term_agg’, >>> ) Yet, the children attribute will then be reset to None to avoid confusion since the real hierarchy is stored in the bpointer/fpointer attributes inherited from treelib.Tree class.

DEFAULT_OPERATOR = NotImplementedError()
PARAMS_WHITELIST = None
classmethod deserialize(*args, **body)[source]
classmethod operator(key)[source]
classmethod params(parent_only=False)[source]

Return map of key -> params that handle children leaves.

class pandagg.node.query.compound.ConstantScore(*args, **kwargs)[source]

Bases: pandagg.node.query.compound.CompoundClause

DEFAULT_OPERATOR

alias of pandagg.node.query._parameter_clause.Filter

KEY = 'constant_score'
PARAMS_WHITELIST = ['filter', 'boost']
class pandagg.node.query.compound.DisMax(*args, **kwargs)[source]

Bases: pandagg.node.query.compound.CompoundClause

DEFAULT_OPERATOR

alias of pandagg.node.query._parameter_clause.Queries

KEY = 'dis_max'
PARAMS_WHITELIST = ['queries', 'tie_breaker']
class pandagg.node.query.compound.FunctionScore(*args, **kwargs)[source]

Bases: pandagg.node.query.compound.CompoundClause

DEFAULT_OPERATOR

alias of pandagg.node.query._parameter_clause.QueryP

KEY = 'function_score'
PARAMS_WHITELIST = ['query', 'boost', 'random_score', 'boost_mode', 'functions', 'max_boost', 'score_mode', 'min_score']