blob: f99bac22d566f2b5327899ac47e185c3288fdcc1 [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Namespace Lucene.Net.QueryParsers.Flexible.Core.Nodes
| Apache Lucene.NET 4.8.0-beta00010 Documentation </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Namespace Lucene.Net.QueryParsers.Flexible.Core.Nodes
| Apache Lucene.NET 4.8.0-beta00010 Documentation ">
<meta name="generator" content="docfx 2.56.0.0">
<link rel="shortcut icon" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/logo/favicon.ico">
<link rel="stylesheet" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.vendor.css">
<link rel="stylesheet" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.css">
<link rel="stylesheet" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/main.css">
<meta property="docfx:navrel" content="toc.html">
<meta property="docfx:tocrel" content="queryparser/toc.html">
<meta property="docfx:rel" content="https://lucenenet.apache.org/docs/4.8.0-beta00009/">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
<img id="logo" class="svg" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/logo/lucene-net-color.png" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search">
<ul class="level0 breadcrumb">
<li>
<a href="https://lucenenet.apache.org/docs/4.8.0-beta00009/">API</a>
<span id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</span>
</li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list"></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Lucene.Net.QueryParsers.Flexible.Core.Nodes">
<h1 id="Lucene_Net_QueryParsers_Flexible_Core_Nodes" data-uid="Lucene.Net.QueryParsers.Flexible.Core.Nodes" class="text-break">Namespace Lucene.Net.QueryParsers.Flexible.Core.Nodes
</h1>
<div class="markdown level0 summary"><!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<p>Query nodes commonly used by query parser implementations.</p>
<h2 id="query-nodes">Query Nodes</h2>
<p> The package <tt>org.apache.lucene.queryParser.nodes</tt> contains all the basic query nodes. The interface that represents a query node is <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.QueryNode.html">QueryNode</a>. </p>
<p> <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.QueryNode.html">QueryNode</a>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 <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Standard.Parser.StandardSyntaxParser.html">StandardSyntaxParser</a>, it implements Lucene&#39;s standard syntax. </p>
<p> <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.QueryNode.html">QueryNode</a> interface should be implemented by all query nodes, the class &lt;xref:Lucene.Net.QueryParsers.Flexible.Core.Nodes.QueryNodeImpl&gt; implements <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.QueryNode.html">QueryNode</a> and is extended by all current query node implementations. </p>
<p> A query node tree can be printed to the a stream, and it generates a pseudo XML representation with all the nodes. </p>
<p> 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. </p>
<p> 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 * NumericRangeQueryNode - used for numeric range search * TokenizedPhraseQueryNode - used by tokenizers/lemmatizers/analyzers for phrases/autophrases </p>
<p> Leaf Nodes: * FieldQueryNode - field/value node * NumericQueryNode - used for numeric search * PathQueryNode - <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.QueryNode.html">QueryNode</a> 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 </p>
<p> 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 </p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="markdown level0 remarks"></div>
<h3 id="classes">Classes
</h3>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.AndQueryNode.html">AndQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.AndQueryNode.html">AndQueryNode</a> represents an AND boolean operation performed on a
list of nodes.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.AnyQueryNode.html">AnyQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.AnyQueryNode.html">AnyQueryNode</a> represents an ANY operator performed on a list of
nodes.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.BooleanQueryNode.html">BooleanQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.BooleanQueryNode.html">BooleanQueryNode</a> represents a list of elements which do not have an
explicit boolean operator defined between them. It can be used to express a
boolean query that intends to use the default boolean operator.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.BoostQueryNode.html">BoostQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.BoostQueryNode.html">BoostQueryNode</a> boosts the QueryNode tree which is under this node.
So, it must only and always have one child.</p>
<p>The boost value may vary from 0.0 to 1.0.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.DeletedQueryNode.html">DeletedQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.DeletedQueryNode.html">DeletedQueryNode</a> represents a node that was deleted from the query
node tree. It can be removed from the tree using the
<a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Processors.RemoveDeletedQueryNodesProcessor.html">RemoveDeletedQueryNodesProcessor</a> processor.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.FieldQueryNode.html">FieldQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.FieldQueryNode.html">FieldQueryNode</a> represents a element that contains field/text tuple</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.FuzzyQueryNode.html">FuzzyQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.FuzzyQueryNode.html">FuzzyQueryNode</a> represents a element that contains
field/text/similarity tuple</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.GroupQueryNode.html">GroupQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.GroupQueryNode.html">GroupQueryNode</a> represents a location where the original user typed
real parenthesis on the query string. This class is useful for queries like:
a) a AND b OR c b) ( a AND b) OR c</p>
<p>Parenthesis might be used to define the boolean operation precedence.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.MatchAllDocsQueryNode.html">MatchAllDocsQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.MatchAllDocsQueryNode.html">MatchAllDocsQueryNode</a> indicates that a query node tree or subtree
will match all documents if executed in the index.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.MatchNoDocsQueryNode.html">MatchNoDocsQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.MatchNoDocsQueryNode.html">MatchNoDocsQueryNode</a> indicates that a query node tree or subtree
will not match any documents if executed in the index.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.ModifierExtensions.html">ModifierExtensions</a></h4>
<section></section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.ModifierQueryNode.html">ModifierQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.ModifierQueryNode.html">ModifierQueryNode</a> indicates the modifier value (+,-,?,NONE) for
each term on the query string. For example &quot;+t1 -t2 t3&quot; will have a tree of:
<blockquote>
&lt;BooleanQueryNode&gt; &lt;ModifierQueryNode modifier=&quot;MOD_REQ&quot;&gt; &lt;t1/&gt;
&lt;/ModifierQueryNode&gt; &lt;ModifierQueryNode modifier=&quot;MOD_NOT&quot;&gt; &lt;t2/&gt;
&lt;/ModifierQueryNode&gt; &lt;t3/&gt; &lt;/BooleanQueryNode&gt;
</blockquote></p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.NoTokenFoundQueryNode.html">NoTokenFoundQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.NoTokenFoundQueryNode.html">NoTokenFoundQueryNode</a> is used if a term is convert into no tokens
by the tokenizer/lemmatizer/analyzer (null).</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.OpaqueQueryNode.html">OpaqueQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.OpaqueQueryNode.html">OpaqueQueryNode</a> is used for specify values that are not supposed to
be parsed by the parser. For example: and XPATH query in the middle of a
query string a b @xpath:&amp;apos;/bookstore/book[1]/title&amp;apos; c d</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.OrQueryNode.html">OrQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.OrQueryNode.html">OrQueryNode</a> represents an OR boolean operation performed on a list
of nodes.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.PathQueryNode.html">PathQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.PathQueryNode.html">PathQueryNode</a> 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.
<p>
Example how the text parser creates these objects:
</p></p>
<pre><code>IList&lt;PathQueryNode.QueryText> values = new List&lt;PathQueryNode.QueryText>();
values.Add(new PathQueryNode.QueryText(&quot;company&quot;, 1, 7));
values.Add(new PathQueryNode.QueryText(&quot;USA&quot;, 9, 12));
values.Add(new PathQueryNode.QueryText(&quot;California&quot;, 14, 23));
QueryNode q = new PathQueryNode(values);</code></pre>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.PathQueryNode.QueryText.html">PathQueryNode.QueryText</a></h4>
<section><p>Term text with a beginning and end position</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.PhraseSlopQueryNode.html">PhraseSlopQueryNode</a></h4>
<section><p>Query node for <a class="xref" href="http://localhost:8080/api/core/Lucene.Net.Search.PhraseQuery.html">PhraseQuery</a>&apos;s slop factor.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.ProximityQueryNode.html">ProximityQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.ProximityQueryNode.html">ProximityQueryNode</a> represents a query where the terms should meet
specific distance conditions. (a b c) WITHIN [SENTENCE|PARAGRAPH|NUMBER]
[INORDER] (&quot;a&quot; &quot;b&quot; &quot;c&quot;) WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER]</p>
<p>TODO: Add this to the future standard Lucene parser/processor/builder</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.ProximityQueryNode_TypeExtensions.html">ProximityQueryNode_TypeExtensions</a></h4>
<section></section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.ProximityType.html">ProximityType</a></h4>
<section><p>utility class containing the distance condition and number</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.QueryNode.html">QueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.QueryNode.html">QueryNode</a> is the default implementation of the interface
<a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IQueryNode.html">IQueryNode</a></p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.QuotedFieldQueryNode.html">QuotedFieldQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.QuotedFieldQueryNode.html">QuotedFieldQueryNode</a> represents phrase query. Example:
&quot;life is great&quot;</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.SlopQueryNode.html">SlopQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.SlopQueryNode.html">SlopQueryNode</a> represents phrase query with a slop.</p>
<p>From Lucene FAQ: Is there a way to use a proximity operator (like near or
within) with Lucene? There is a variable called slop that allows you to
perform NEAR/WITHIN-like queries. By default, slop is set to 0 so that only
exact phrases will match. When using TextParser you can use this syntax to
specify the slop: &quot;doug cutting&quot;~2 will find documents that contain
&quot;doug cutting&quot; as well as ones that contain &quot;cutting doug&quot;.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.TokenizedPhraseQueryNode.html">TokenizedPhraseQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.TokenizedPhraseQueryNode.html">TokenizedPhraseQueryNode</a> represents a node created by a code that
tokenizes/lemmatizes/analyzes.</p>
</section>
<h3 id="interfaces">Interfaces
</h3>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IFieldableNode.html">IFieldableNode</a></h4>
<section><p>A query node implements <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IFieldableNode.html">IFieldableNode</a> interface to indicate that its
children and itself are associated to a specific field.</p>
<p>If it has any children which also implements this interface, it must ensure
the children are associated to the same field.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IFieldValuePairQueryNode-1.html">IFieldValuePairQueryNode&lt;T&gt;</a></h4>
<section><p>This interface should be implemented by <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IQueryNode.html">IQueryNode</a> that holds a field
and an arbitrary value.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IQueryNode.html">IQueryNode</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IQueryNode.html">IQueryNode</a> is a interface implemented by all nodes on a <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IQueryNode.html">IQueryNode</a>
tree.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IRangeQueryNode.html">IRangeQueryNode</a></h4>
<section><p>LUCENENET specific interface for identifying a
RangeQueryNode without specifying its generic closing type</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IRangeQueryNode-1.html">IRangeQueryNode&lt;T&gt;</a></h4>
<section><p>This interface should be implemented by an <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IQueryNode.html">IQueryNode</a> that represents
some kind of range query.</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.ITextableQueryNode.html">ITextableQueryNode</a></h4>
<section><p>Interface for a node that has text as a <span class="xref">J2N.Text.ICharSequence</span></p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IValueQueryNode-1.html">IValueQueryNode&lt;T&gt;</a></h4>
<section><p>This interface should be implemented by <a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.IQueryNode.html">IQueryNode</a> that holds an
arbitrary value.</p>
</section>
<h3 id="enums">Enums
</h3>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.Modifier.html">Modifier</a></h4>
<section><p>Modifier type: such as required (REQ), prohibited (NOT)</p>
</section>
<h4><a class="xref" href="Lucene.Net.QueryParsers.Flexible.Core.Nodes.ProximityQueryNode.Type.html">ProximityQueryNode.Type</a></h4>
<section><p>Distance condition: PARAGRAPH, SENTENCE, or NUMBER</p>
</section>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/apache/lucenenet/blob/docs/4.8.0-beta00010/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/package.md/#L2" class="contribution-link">Improve this Doc</a>
</li>
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
Copyright © 2020 Licensed to the Apache Software Foundation (ASF)
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.vendor.js"></script>
<script type="text/javascript" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.js"></script>
<script type="text/javascript" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/main.js"></script>
</body>
</html>