Class QueryNode
A QueryNode is the default implementation of the interface IQueryNode
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.QueryParsers.Flexible.Core.Nodes
Assembly: Lucene.Net.QueryParser.dll
Syntax
public abstract class QueryNode : IQueryNode
Fields
PLAINTEXT_FIELD_NAME
index default field
Declaration
public static readonly string PLAINTEXT_FIELD_NAME
Field Value
Type | Description |
---|---|
string |
m_toQueryStringIgnoreFields
If set to true the the method toQueryString will not write field names
Declaration
protected bool m_toQueryStringIgnoreFields
Field Value
Type | Description |
---|---|
bool |
Properties
IsLeaf
verify if a node is a Leaf node
Declaration
public virtual bool IsLeaf { get; protected set; }
Property Value
Type | Description |
---|---|
bool |
IsRoot
A QueryNode is the default implementation of the interface IQueryNode
Declaration
protected virtual bool IsRoot { get; }
Property Value
Type | Description |
---|---|
bool |
Parent
A QueryNode is the default implementation of the interface IQueryNode
Declaration
public virtual IQueryNode Parent { get; }
Property Value
Type | Description |
---|---|
IQueryNode |
TagMap
Gets a map containing all tags attached to this query node.
Declaration
public virtual IDictionary<string, object> TagMap { get; }
Property Value
Type | Description |
---|---|
IDictionary<string, object> |
Methods
Add(IQueryNode)
add a new child to a non Leaf node
Declaration
public void Add(IQueryNode child)
Parameters
Type | Name | Description |
---|---|---|
IQueryNode | child |
Add(IList<IQueryNode>)
A QueryNode is the default implementation of the interface IQueryNode
Declaration
public void Add(IList<IQueryNode> children)
Parameters
Type | Name | Description |
---|---|---|
IList<IQueryNode> | children |
Allocate()
A QueryNode is the default implementation of the interface IQueryNode
Declaration
protected virtual void Allocate()
Clone()
A QueryNode is the default implementation of the interface IQueryNode
Declaration
public virtual object Clone()
Returns
Type | Description |
---|---|
object |
CloneTree()
Recursive clone the IQueryNode tree. The tags are not copied to the new tree when you call the CloneTree() method.
Declaration
public virtual IQueryNode CloneTree()
Returns
Type | Description |
---|---|
IQueryNode | the cloned tree |
ContainsTag(string)
verify if a node contains a tag
Declaration
public virtual bool ContainsTag(string tagName)
Parameters
Type | Name | Description |
---|---|---|
string | tagName |
Returns
Type | Description |
---|---|
bool |
GetChildren()
a List for QueryNode object. Returns null, for nodes that do not contain children. All leaf Nodes return null.
Declaration
public IList<IQueryNode> GetChildren()
Returns
Type | Description |
---|---|
IList<IQueryNode> |
GetTag(string)
Returns object stored under that tag name
Declaration
public virtual object GetTag(string tagName)
Parameters
Type | Name | Description |
---|---|---|
string | tagName |
Returns
Type | Description |
---|---|
object |
IsDefaultField(string)
This method is use toQueryString to detect if fld is the default field
Declaration
protected virtual bool IsDefaultField(string fld)
Parameters
Type | Name | Description |
---|---|---|
string | fld | field name |
Returns
Type | Description |
---|---|
bool | true if fld is the default field |
RemoveChildren(IQueryNode)
Remove a child node.
Declaration
public virtual void RemoveChildren(IQueryNode childNode)
Parameters
Type | Name | Description |
---|---|---|
IQueryNode | childNode | Which child to remove. |
RemoveFromParent()
Removes this query node from its parent.
Declaration
public virtual void RemoveFromParent()
Set(IList<IQueryNode>)
reset the children of a node
Declaration
public void Set(IList<IQueryNode> children)
Parameters
Type | Name | Description |
---|---|---|
IList<IQueryNode> | children |
SetTag(string, object)
Associate the specified value with the specified tagName
. If the tagName
already exists, the old value is replaced. The tagName
and value
cannot be
null. tagName
will be converted to lowercase.
Declaration
public virtual void SetTag(string tagName, object value)
Parameters
Type | Name | Description |
---|---|---|
string | tagName | |
object | value |
ToQueryString(IEscapeQuerySyntax)
convert to a query string understood by the query parser
Declaration
public abstract string ToQueryString(IEscapeQuerySyntax escapeSyntaxParser)
Parameters
Type | Name | Description |
---|---|---|
IEscapeQuerySyntax | escapeSyntaxParser |
Returns
Type | Description |
---|---|
string |
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 |
Overrides
See Also
TryGetTag(string, out object)
Gets the tag associated with the specified tagName.
Declaration
public virtual bool TryGetTag(string tagName, out object tag)
Parameters
Type | Name | Description |
---|---|---|
string | tagName | |
object | tag |
Returns
Type | Description |
---|---|
bool |
UnsetTag(string)
Unset a tag. tagName
will be converted to lowercase.
Declaration
public virtual void UnsetTag(string tagName)
Parameters
Type | Name | Description |
---|---|---|
string | tagName |