Class ProximityQueryNode
A ProximityQueryNode represents a query where the terms should meet specific distance conditions. (a b c) WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER] ("a" "b" "c") WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER]
TODO: Add this to the future standard Lucene parser/processor/builder
Implements
Inherited Members
Namespace: Lucene.Net.QueryParsers.Flexible.Core.Nodes
Assembly: Lucene.Net.QueryParser.dll
Syntax
public class ProximityQueryNode : BooleanQueryNode, IQueryNode
Constructors
ProximityQueryNode(IList<IQueryNode>, string, Type, bool)
A ProximityQueryNode represents a query where the terms should meet specific distance conditions. (a b c) WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER] ("a" "b" "c") WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER]
TODO: Add this to the future standard Lucene parser/processor/builder
Declaration
public ProximityQueryNode(IList<IQueryNode> clauses, string field, ProximityQueryNode.Type type, bool inorder)
Parameters
Type | Name | Description |
---|---|---|
IList<IQueryNode> | clauses | QueryNode children |
string | field | field name |
ProximityQueryNode.Type | type | type of proximity query |
bool | inorder | true, if the tokens should be matched in the order of the clauses |
ProximityQueryNode(IList<IQueryNode>, string, Type, int, bool)
A ProximityQueryNode represents a query where the terms should meet specific distance conditions. (a b c) WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER] ("a" "b" "c") WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER]
TODO: Add this to the future standard Lucene parser/processor/builder
Declaration
public ProximityQueryNode(IList<IQueryNode> clauses, string field, ProximityQueryNode.Type type, int distance, bool inorder)
Parameters
Type | Name | Description |
---|---|---|
IList<IQueryNode> | clauses | QueryNode children |
string | field | field name |
ProximityQueryNode.Type | type | type of proximity query |
int | distance | positive integer that specifies the distance |
bool | inorder | true, if the tokens should be matched in the order of the clauses |
Properties
Distance
Gets the distance
Declaration
public virtual int Distance { get; }
Property Value
Type | Description |
---|---|
int |
Field
Gets or Sets the field. Returns null if the field was not specified in the query string.
Declaration
public virtual string Field { get; set; }
Property Value
Type | Description |
---|---|
string |
IsInOrder
terms must be matched in the specified order
Declaration
public virtual bool IsInOrder { get; }
Property Value
Type | Description |
---|---|
bool |
ProximityType
A ProximityQueryNode represents a query where the terms should meet specific distance conditions. (a b c) WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER] ("a" "b" "c") WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER]
TODO: Add this to the future standard Lucene parser/processor/builder
Declaration
public virtual ProximityQueryNode.Type ProximityType { get; }
Property Value
Type | Description |
---|---|
ProximityQueryNode.Type |
Methods
CloneTree()
Recursive clone the IQueryNode tree. The tags are not copied to the new tree when you call the CloneTree() method.
Declaration
public override IQueryNode CloneTree()
Returns
Type | Description |
---|---|
IQueryNode | the cloned tree |
Overrides
GetFieldAsString()
Gets the field as a string. Returns null if the field was not specified in the query string.
Declaration
public virtual string GetFieldAsString()
Returns
Type | Description |
---|---|
string |
ToQueryString(IEscapeQuerySyntax)
convert to a query string understood by the query parser
Declaration
public override string ToQueryString(IEscapeQuerySyntax escapeSyntaxParser)
Parameters
Type | Name | Description |
---|---|---|
IEscapeQuerySyntax | escapeSyntaxParser |
Returns
Type | Description |
---|---|
string |
Overrides
ToString()
Every implementation of this class should return pseudo xml like this:
For FieldQueryNode: <field start='1' end='2' field='subject' text='foo'/>
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |