Class PathQueryNode
A PathQueryNode is used to store queries like /company/USA/California /product/shoes/brown. QueryText are objects that contain the text, begin position and end position in the query.
Example how the text parser creates these objects:
IList<PathQueryNode.QueryText> values = new List<PathQueryNode.QueryText>();
values.Add(new PathQueryNode.QueryText("company", 1, 7));
values.Add(new PathQueryNode.QueryText("USA", 9, 12));
values.Add(new PathQueryNode.QueryText("California", 14, 23));
QueryNode q = new PathQueryNode(values);
Implements
Inherited Members
Namespace: Lucene.Net.QueryParsers.Flexible.Core.Nodes
Assembly: Lucene.Net.QueryParser.dll
Syntax
public class PathQueryNode : QueryNode, IQueryNode
Constructors
PathQueryNode(IList<QueryText>)
A PathQueryNode is used to store queries like /company/USA/California /product/shoes/brown. QueryText are objects that contain the text, begin position and end position in the query.
Example how the text parser creates these objects:
IList<PathQueryNode.QueryText> values = new List<PathQueryNode.QueryText>();
values.Add(new PathQueryNode.QueryText("company", 1, 7));
values.Add(new PathQueryNode.QueryText("USA", 9, 12));
values.Add(new PathQueryNode.QueryText("California", 14, 23));
QueryNode q = new PathQueryNode(values);
Declaration
public PathQueryNode(IList<PathQueryNode.QueryText> pathElements)
Parameters
Type | Name | Description |
---|---|---|
IList<PathQueryNode.QueryText> | pathElements | List of QueryText objects |
Properties
PathElements
Gets or Sets the a List with all QueryText elements
Declaration
public virtual IList<PathQueryNode.QueryText> PathElements { get; set; }
Property Value
Type | Description |
---|---|
IList<PathQueryNode.QueryText> | QueryText List size |
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
GetFirstPathElement()
Returns the string value of a specific QueryText element
Declaration
public virtual string GetFirstPathElement()
Returns
Type | Description |
---|---|
string | The string for a specific QueryText element |
GetPathElement(int)
Returns the a specific QueryText element
Declaration
public virtual PathQueryNode.QueryText GetPathElement(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index |
Returns
Type | Description |
---|---|
PathQueryNode.QueryText | QueryText List size |
GetPathElements(int)
Returns a List QueryText element from position startIndex
Declaration
public virtual IList<PathQueryNode.QueryText> GetPathElements(int startIndex)
Parameters
Type | Name | Description |
---|---|---|
int | startIndex |
Returns
Type | Description |
---|---|
IList<PathQueryNode.QueryText> | a List QueryText element from position |
ToQueryString(IEscapeQuerySyntax)
convert to a query string understood by the query parser
Declaration
public override string ToQueryString(IEscapeQuerySyntax escaper)
Parameters
Type | Name | Description |
---|---|---|
IEscapeQuerySyntax | escaper |
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 |