C# Class Lucene.Net.QueryParsers.Flexible.Standard.Processors.BooleanQuery2ModifierNodeProcessor

This processor is used to apply the correct ModifierQueryNode to BooleanQueryNodes children. This is a variant of Precedence.Processors.BooleanModifiersQueryNodeProcessor which ignores precedence. The Parser.StandardSyntaxParser knows the rules of precedence, but lucene does not. e.g. (A AND B OR C AND D) ist treated like (+A +B +C +D). This processor walks through the query node tree looking for BooleanQueryNodes. If an AndQueryNode is found, every child, which is not a ModifierQueryNode or the ModifierQueryNode is Modifier.MOD_NONE, becomes a Modifier.MOD_REQ. For default BooleanQueryNode, it checks the default operator is Operator.AND, if it is, the same operation when an AndQueryNode is found is applied to it. Each BooleanQueryNode which direct parent is also a BooleanQueryNode is removed (to ignore the rules of precedence).
Inheritance: IQueryNodeProcessor
ファイルを表示 Open project: apache/lucenenet

Public Methods

Method Description
BooleanQuery2ModifierNodeProcessor ( ) : Lucene.Net.QueryParsers.Flexible.Core.Config
GetQueryConfigHandler ( ) : QueryConfigHandler
Process ( IQueryNode queryTree ) : IQueryNode
SetQueryConfigHandler ( QueryConfigHandler queryConfigHandler ) : void

Protected Methods

Method Description
FillChildrenBufferAndApplyModifiery ( IQueryNode parent ) : void
IsDefaultBooleanQueryNode ( IQueryNode toTest ) : bool
PostProcessNode ( IQueryNode node ) : IQueryNode
PreProcessNode ( IQueryNode node ) : IQueryNode
ProcessChildren ( IQueryNode queryTree ) : void
TagModifierButDoNotOverride ( IQueryNode node, Modifier mod ) : void

Private Methods

Method Description
ApplyModifier ( IQueryNode node, Modifier mod ) : IQueryNode
ProcessIteration ( IQueryNode queryTree ) : IQueryNode

Method Details

BooleanQuery2ModifierNodeProcessor() public method

public BooleanQuery2ModifierNodeProcessor ( ) : Lucene.Net.QueryParsers.Flexible.Core.Config
return Lucene.Net.QueryParsers.Flexible.Core.Config

FillChildrenBufferAndApplyModifiery() protected method

protected FillChildrenBufferAndApplyModifiery ( IQueryNode parent ) : void
parent IQueryNode
return void

GetQueryConfigHandler() public method

public GetQueryConfigHandler ( ) : QueryConfigHandler
return Lucene.Net.QueryParsers.Flexible.Core.Config.QueryConfigHandler

IsDefaultBooleanQueryNode() protected method

protected IsDefaultBooleanQueryNode ( IQueryNode toTest ) : bool
toTest IQueryNode
return bool

PostProcessNode() protected method

protected PostProcessNode ( IQueryNode node ) : IQueryNode
node IQueryNode
return IQueryNode

PreProcessNode() protected method

protected PreProcessNode ( IQueryNode node ) : IQueryNode
node IQueryNode
return IQueryNode

Process() public method

public Process ( IQueryNode queryTree ) : IQueryNode
queryTree IQueryNode
return IQueryNode

ProcessChildren() protected method

protected ProcessChildren ( IQueryNode queryTree ) : void
queryTree IQueryNode
return void

SetQueryConfigHandler() public method

public SetQueryConfigHandler ( QueryConfigHandler queryConfigHandler ) : void
queryConfigHandler Lucene.Net.QueryParsers.Flexible.Core.Config.QueryConfigHandler
return void

TagModifierButDoNotOverride() protected method

protected TagModifierButDoNotOverride ( IQueryNode node, Modifier mod ) : void
node IQueryNode
mod Modifier
return void