class documentation

A `lunr.Query` provides a programmatic way of defining queries to be performed against a `lunr.Index`. Prefer constructing a `lunr.Query` using `the lunr.Index.query` method so the query object is pre-initialized with the right index fields.

Method __init__ Undocumented
Method __repr__ Undocumented
Method clause Adds a `lunr.Clause` to this query.
Method is_negated A negated query is one in which every clause has a presence of prohibited. These queries require some special processing to return the expected results.
Method term Adds a term to the current query, creating a Clause and adds it to the list of clauses making up this Query.
Constant WILDCARD Undocumented
Constant WILDCARD_LEADING Undocumented
Constant WILDCARD_NONE Undocumented
Constant WILDCARD_TRAILING Undocumented
Instance Variable all_fields Undocumented
Instance Variable clauses Undocumented
def __init__(self, all_fields): (source)

Undocumented

def __repr__(self): (source)

Undocumented

def clause(self, *args, **kwargs): (source)

Adds a `lunr.Clause` to this query. Unless the clause contains the fields to be matched all fields will be matched. In addition a default boost of 1 is applied to the clause. If the first argument is a `lunr.Clause` it will be mutated and added, otherwise args and kwargs will be used in the constructor. Returns: lunr.Query: The Query itself.

def is_negated(self): (source)

A negated query is one in which every clause has a presence of prohibited. These queries require some special processing to return the expected results.

def term(self, term, **kwargs): (source)

Adds a term to the current query, creating a Clause and adds it to the list of clauses making up this Query. The term is not tokenized and used "as is". Any conversion to token or token-like strings should be performed before calling this method. For example: query.term(lunr.Tokenizer("foo bar")) Args: term (Token or iterable): Token or iterable of tokens to add. kwargs (dict): Additional properties to add to the Clause.

WILDCARD: str = (source)

Undocumented

Value
'*'
WILDCARD_LEADING: int = (source)

Undocumented

Value
1
WILDCARD_NONE: int = (source)

Undocumented

Value
0
WILDCARD_TRAILING: int = (source)

Undocumented

Value
2
all_fields = (source)

Undocumented

clauses: list = (source)

Undocumented