Package org.apache.lucene.queryparser.flexible.core.nodes
Query Nodes
The package org.apache.lucene.queryParser.nodes
contains all the basic query
nodes. The interface that represents a query node is QueryNode
.
QueryNode
s are used by the text
parser to create a syntax tree. These nodes are designed to be used by UI or other text parsers.
The default Lucene text parser is StandardSyntaxParser
, it implements
Lucene's standard syntax.
QueryNode
interface should be
implemented by all query nodes, the class QueryNodeImpl
implements QueryNode
and is extended by all current query
node implementations.
A query node tree can be printed to the a stream, and it generates a pseudo XML representation with all the nodes.
A query node tree can also generate a query string that can be parsed back by the original text parser, at this point only the standard lucene syntax is supported.
Grouping nodes:
- AndQueryNode - used for AND operator
- AnyQueryNode - used for ANY operator
- OrQueryNode - used for OR operator
- BooleanQueryNode - used when no operator is specified
- ModifierQueryNode - used for modifier operator
- GroupQueryNode - used for parenthesis
- BoostQueryNode - used for boost operator
- SlopQueryNode - phrase slop
- FuzzyQueryNode - fuzzy node
- TermRangeQueryNode - used for parametric field:[low_value TO high_value]
- ProximityQueryNode - used for proximity search
- LegacyNumericRangeQueryNode - used for numeric range search
- TokenizedPhraseQueryNode - used by tokenizers/lemmatizers/analyzers for phrases/autophrases
Leaf Nodes:
- FieldQueryNode - field/value node
- LegacyNumericQueryNode - used for numeric search
- PathQueryNode -
QueryNode
object used with path-like queries - OpaqueQueryNode - Used as for part of the query that can be parsed by other parsers. schema/value
- PrefixWildcardQueryNode - non-phrase wildcard query
- QuotedFieldQUeryNode - regular phrase node
- WildcardQueryNode - non-phrase wildcard query
Utility Nodes:
- DeletedQueryNode - used by processors on optimizations
- MatchAllDocsQueryNode - used by processors on optimizations
- MatchNoDocsQueryNode - used by processors on optimizations
- NoTokenFoundQueryNode - used by tokenizers/lemmatizers/analyzers
-
Interface Summary Interface Description FieldableNode A query node implementsFieldableNode
interface to indicate that its children and itself are associated to a specific field.FieldValuePairQueryNode<T> This interface should be implemented byQueryNode
that holds a field and an arbitrary value.QueryNode AQueryNode
is a interface implemented by all nodes on a QueryNode tree.RangeQueryNode<T extends FieldValuePairQueryNode<?>> This interface should be implemented by aQueryNode
that represents some kind of range query.TextableQueryNode Interface for a node that has text as aCharSequence
ValueQueryNode<T> This interface should be implemented byQueryNode
that holds an arbitrary value. -
Class Summary Class Description AndQueryNode AAndQueryNode
represents an AND boolean operation performed on a list of nodes.AnyQueryNode AAnyQueryNode
represents an ANY operator performed on a list of nodes.BooleanQueryNode ABooleanQueryNode
represents a list of elements which do not have an explicit boolean operator defined between them.BoostQueryNode ABoostQueryNode
boosts the QueryNode tree which is under this node.DeletedQueryNode ADeletedQueryNode
represents a node that was deleted from the query node tree.FieldQueryNode AFieldQueryNode
represents a element that contains field/text tupleFuzzyQueryNode AFuzzyQueryNode
represents a element that contains field/text/similarity tupleGroupQueryNode AGroupQueryNode
represents a location where the original user typed real parenthesis on the query string.MatchAllDocsQueryNode AMatchAllDocsQueryNode
indicates that a query node tree or subtree will match all documents if executed in the index.MatchNoDocsQueryNode AMatchNoDocsQueryNode
indicates that a query node tree or subtree will not match any documents if executed in the index.ModifierQueryNode AModifierQueryNode
indicates the modifier value (+,-,?,NONE) for each term on the query string.NoTokenFoundQueryNode ANoTokenFoundQueryNode
is used if a term is convert into no tokens by the tokenizer/lemmatizer/analyzer (null).OpaqueQueryNode AOpaqueQueryNode
is used for specify values that are not supposed to be parsed by the parser.OrQueryNode AOrQueryNode
represents an OR boolean operation performed on a list of nodes.PathQueryNode APathQueryNode
is used to store queries like /company/USA/California /product/shoes/brown.PathQueryNode.QueryText Term text with a beginning and end positionPhraseSlopQueryNode Query node forPhraseQuery
's slop factor.ProximityQueryNode AProximityQueryNode
represents a query where the terms should meet specific distance conditions.ProximityQueryNode.ProximityType utility class containing the distance condition and numberQueryNodeImpl AQueryNodeImpl
is the default implementation of the interfaceQueryNode
QuotedFieldQueryNode AQuotedFieldQueryNode
represents phrase query.SlopQueryNode ASlopQueryNode
represents phrase query with a slop.TokenizedPhraseQueryNode ATokenizedPhraseQueryNode
represents a node created by a code that tokenizes/lemmatizes/analyzes. -
Enum Summary Enum Description ModifierQueryNode.Modifier Modifier type: such as required (REQ), prohibited (NOT)ProximityQueryNode.Type Distance condition: PARAGRAPH, SENTENCE, or NUMBER