class Query: (source)
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 |
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 |
Undocumented |
Constant | WILDCARD |
Undocumented |
Constant | WILDCARD |
Undocumented |
Instance Variable | all |
Undocumented |
Instance Variable | clauses |
Undocumented |
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.
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.
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.