1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <meta http-equiv='CONTENT-TYPE' content='text/html; charset=UTF-8' />
4 <link rel='StyleSheet' href='DTDDocStyle.css' type='text/css' media='screen' />
5 <title>Core Lucene</title>
7 <p class='DTDSource'><b><code>LuceneCoreQuery.dtd</code></b>: <a href='LuceneCoreQuery.dtd.html'>Elements</a> - <a href='LuceneCoreQuery.dtd.entities.html'>Entities</a> - <a href='LuceneCoreQuery.dtd.org.html'>Source</a> | <a href='intro.html'>Intro</a> - <a href='elementsIndex.html'>Index</a><br /><a href='index.html' target='_top'>FRAMES</a> / <a href='LuceneCoreQuery.dtd.org.html' target='_top'>NO FRAMES</a></p><pre id='dtd_source'><span class="dtd_comment"><!--</span>
8 <span class="dtd_comment"> <h3>Background</h3></span>
9 <span class="dtd_comment"> This DTD describes the XML syntax used to perform advanced searches using the core Lucene search engine. The motivation behind the XML query syntax is:</span>
10 <span class="dtd_comment"> <ol></span>
11 <span class="dtd_comment"> <li>To open up Lucene functionality to clients other than Java</li></span>
12 <span class="dtd_comment"> <li>To offer a form of expressing queries that can easily be</span>
13 <span class="dtd_comment"> <ul></span>
14 <span class="dtd_comment"> <li>Persisted for logging/auditing purposes</li></span>
15 <span class="dtd_comment"> <li>Changed by editing text query templates (XSLT) without requiring a recompile/redeploy of applications</li></span>
16 <span class="dtd_comment"> <li>Serialized across networks (without requiring Java bytecode for Query logic deployed on clients)</li></span>
17 <span class="dtd_comment"> </ul></span>
18 <span class="dtd_comment"> </li></span>
19 <span class="dtd_comment"> <li>To provide a shorthand way of expressing query logic which echos the logical tree structure of query objects more closely than reading procedural Java query construction code</li></span>
20 <span class="dtd_comment"> <li>To bridge the growing gap between Lucene query/filtering functionality and the set of functionality accessible throught the standard Lucene QueryParser syntax</li></span>
21 <span class="dtd_comment"> <li>To provide a simply extensible syntax that does not require complex parser skills such as knowledge of JavaCC syntax</li></span>
22 <span class="dtd_comment"> </ol></span>
23 <span class="dtd_comment"> </span>
24 <span class="dtd_comment"> </span>
25 <span class="dtd_comment"> <h3>Syntax overview</h3></span>
26 <span class="dtd_comment"> Search syntax consists of two types of elements:</span>
27 <span class="dtd_comment"> <ul></span>
28 <span class="dtd_comment"> <li><i>Queries</i></li></span>
29 <span class="dtd_comment"> <li><i>Filters</i></li></span>
30 <span class="dtd_comment"> </ul></span>
32 <span class="dtd_comment"> <h4>Queries</h4></span>
33 <span class="dtd_comment"> The root of any XML search must be a <i>Query</i> type element used to select content.</span>
34 <span class="dtd_comment"> Queries typically score matches on documents using a number of different factors in order to provide relevant results first. </span>
35 <span class="dtd_comment"> One common example of a query tag is the <a href="#UserQuery">UserQuery</a> element which uses the standard </span>
36 <span class="dtd_comment"> Lucene QueryParser to parse Google-style search syntax provided by end users.</span>
37 <span class="dtd_comment"> </span>
38 <span class="dtd_comment"> <h4>Filters</h4></span>
39 <span class="dtd_comment"> Unlike Queries, <i>Filters</i> are not used to select or score content - they are simply used to filter <i>Query</i> output (see <a href="#FilteredQuery">FilteredQuery</a> for an example use of query filtering).</span>
40 <span class="dtd_comment"> Because Filters simply offer a yes/no decision for each document in the index their output can be efficiently cached in memory as a <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/BitSet.html">Bitset</a> for</span>
41 <span class="dtd_comment"> subsequent reuse (see <a href="#CachedFilter">CachedFilter</a> tag).</span>
43 <span class="dtd_comment"> <h4>Nesting elements</h4></span>
44 <span class="dtd_comment"> Many of the the elements can nest other elements to produce queries/filters of an arbitrary depth and complexity. </span>
45 <span class="dtd_comment"> The <a href="#BooleanQuery">BooleanQuery</a> element is one such example which provides a means for combining other queries (including other BooleanQueries) using Boolean </span>
46 <span class="dtd_comment"> logic to determine mandatory or optional elements. </span>
48 <span class="dtd_comment"> </span>
49 <span class="dtd_comment"> <h3>Advanced topics</h3> </span>
50 <span class="dtd_comment"> <h4>Advanced positional testing - span queries</h4></span>
51 <span class="dtd_comment"> The <i>SpanQuery</i> class of queries allow for complex positional tests which not only look for certain combinations of words but in particular </span>
52 <span class="dtd_comment"> positions in relation to each other and the documents containing them.</span>
53 <span class="dtd_comment"> </span>
54 <span class="dtd_comment"> </span>
55 <span class="dtd_comment"> CoreParser.java is the Java class that encapsulates this parser behaviour.</span>
56 <span class="dtd_comment"> </span>
57 <span class="dtd_comment"> </span>
58 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@title</span><span class="dtd_comment"> Core Lucene </span>
59 <span class="dtd_comment">--></span>
61 <span class="dtd_comment"><!-- </span><span class="dtd_dtddoc_tag">@hidden</span><span class="dtd_comment"> Define core types of XML elements --></span>
62 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ENTITY</span><span class="dtd_plain"> % </span><span class="dtd_attribute_name">coreSpanQueries</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"SpanOr|SpanNear|SpanOrTerms|SpanFirst|SpanNot|SpanTerm|BoostingTermQuery"</span><span class="dtd_plain"> </span><span class="dtd_tag_symbols">></span>
63 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ENTITY</span><span class="dtd_plain"> % </span><span class="dtd_attribute_name">coreQueries</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"BooleanQuery|UserQuery|FilteredQuery|TermQuery|TermsQuery|MatchAllDocsQuery|ConstantScoreQuery|BoostingTermQuery|NumericRangeQuery"</span><span class="dtd_plain"> </span><span class="dtd_tag_symbols">></span>
64 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ENTITY</span><span class="dtd_plain"> % </span><span class="dtd_attribute_name">coreFilters</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"RangeFilter|NumericRangeFilter|CachedFilter"</span><span class="dtd_plain"> </span><span class="dtd_tag_symbols">></span>
66 <span class="dtd_comment"><!-- </span><span class="dtd_dtddoc_tag">@hidden</span><span class="dtd_comment"> Allow for extensions --></span>
67 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ENTITY</span><span class="dtd_plain"> % </span><span class="dtd_attribute_name">extendedSpanQueries1</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">" "</span><span class="dtd_plain"> </span><span class="dtd_tag_symbols">></span>
68 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ENTITY</span><span class="dtd_plain"> % </span><span class="dtd_attribute_name">extendedQueries1</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">" "</span><span class="dtd_plain"> </span><span class="dtd_tag_symbols">></span>
69 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ENTITY</span><span class="dtd_plain"> % </span><span class="dtd_attribute_name">extendedFilters1</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">" "</span><span class="dtd_plain"> </span><span class="dtd_tag_symbols">></span>
71 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ENTITY</span><span class="dtd_plain"> % </span><span class="dtd_attribute_name">spanQueries</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"%coreSpanQueries;%extendedSpanQueries1;"</span><span class="dtd_plain"> </span><span class="dtd_tag_symbols">></span>
72 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ENTITY</span><span class="dtd_plain"> % </span><span class="dtd_attribute_name">queries</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"%coreQueries;|%spanQueries;%extendedQueries1;"</span><span class="dtd_plain"> </span><span class="dtd_tag_symbols">></span>
75 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ENTITY</span><span class="dtd_plain"> % </span><span class="dtd_attribute_name">filters</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"%coreFilters;%extendedFilters1;"</span><span class="dtd_plain"> </span><span class="dtd_tag_symbols">></span>
77 <span class="dtd_comment"><!--</span>
78 <span class="dtd_comment"> BooleanQuerys implement Boolean logic which controls how multiple Clauses should be interpreted.</span>
79 <span class="dtd_comment"> Some clauses may represent optional Query criteria while others represent mandatory criteria. </span>
80 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> </span>
81 <span class="dtd_comment"> <em>Find articles about banks, preferably talking about mergers but nothing to do with "sumitomo"</em></span>
82 <span class="dtd_comment"> % </span>
83 <span class="dtd_comment"> <BooleanQuery fieldName="contents"></span>
84 <span class="dtd_comment"> <Clause occurs="should"></span>
85 <span class="dtd_comment"> <TermQuery>merger</TermQuery></span>
86 <span class="dtd_comment"> </Clause></span>
87 <span class="dtd_comment"> <Clause occurs="mustnot"></span>
88 <span class="dtd_comment"> <TermQuery>sumitomo</TermQuery></span>
89 <span class="dtd_comment"> </Clause></span>
90 <span class="dtd_comment"> <Clause occurs="must"></span>
91 <span class="dtd_comment"> <TermQuery>bank</TermQuery></span>
92 <span class="dtd_comment"> </Clause></span>
93 <span class="dtd_comment"> </BooleanQuery></span>
95 <span class="dtd_comment"> %</span>
96 <span class="dtd_comment">--></span><span class="dtd_plain"> </span>
97 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">BooleanQuery</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">Clause</span><span class="dtd_plain">)+</span><span class="dtd_tag_symbols">></span>
98 <span class="dtd_comment"><!-- Optional boost for matches on this query. Values > 1 --></span>
99 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">BooleanQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">boost</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"1.0"</span><span class="dtd_tag_symbols">></span>
100 <span class="dtd_comment"><!-- fieldName can optionally be defined here as a default attribute used by all child elements --></span><span class="dtd_plain"> </span>
101 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">BooleanQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">fieldName</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#IMPLIED</span><span class="dtd_tag_symbols">></span>
102 <span class="dtd_comment"><!-- The "Coordination factor" rewards documents that contain more of the optional clauses in this list. This flag can be used to turn off this factor. --></span>
103 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">BooleanQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">disableCoord</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">true</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">false</span><span class="dtd_plain">) </span><span class="dtd_attribute_value">"false"</span><span class="dtd_tag_symbols">></span>
104 <span class="dtd_comment"><!-- The minimum number of optional clauses that should be present in any one document before it is considered to be a match. --></span>
105 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">BooleanQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">minimumNumberShouldMatch</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"0"</span><span class="dtd_tag_symbols">></span>
107 <span class="dtd_comment"><!-- NOTE: "Clause" tag has 2 modes of use - inside <BooleanQuery> in which case only "query" types can be</span>
108 <span class="dtd_comment"> child elements - while in a <BooleanFilter> clause only "filter" types can be contained.</span>
109 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@hidden</span><span class="dtd_comment"> TODO: Change BooleanFilterBuilder and BooleanQueryBuilder to auto-wrap choice of query or filters. This type of</span>
110 <span class="dtd_comment"> code already exists in CachedFilter so could be reused.</span>
111 <span class="dtd_comment">--></span><span class="dtd_plain"> </span>
112 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">Clause</span><span class="dtd_plain"> (%</span><span class="dtd_attribute_name">queries</span><span class="dtd_plain">;|%</span><span class="dtd_attribute_name">filters</span><span class="dtd_plain">;)</span><span class="dtd_tag_symbols">></span>
113 <span class="dtd_comment"><!-- Controls if the clause is optional (should), mandatory (must) or unacceptable (mustNot) --></span>
114 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">Clause</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">occurs</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">should</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">must</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">mustnot</span><span class="dtd_plain">) </span><span class="dtd_attribute_value">"should"</span><span class="dtd_tag_symbols">></span>
117 <span class="dtd_comment"><!-- Caches any nested query or filter in an LRU (Least recently used) Cache. Cached queries, like filters, are turned into</span>
118 <span class="dtd_comment"> Bitsets at a cost of 1 bit per document in the index. The memory cost of a cached query/filter is therefore numberOfDocsinIndex/8 bytes.</span>
119 <span class="dtd_comment"> Queries that are cached as filters obviously retain none of the scoring information associated with results - they retain just</span>
120 <span class="dtd_comment"> a Boolean yes/no record of which documents matched. </span>
121 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> </span>
122 <span class="dtd_comment"> <em>Search for documents about banks from the last 10 years - caching the commonly-used "last 10 year" filter as a BitSet in </span>
123 <span class="dtd_comment"> RAM to eliminate the cost of building this filter from disk for every query</em></span>
124 <span class="dtd_comment"> % </span>
125 <span class="dtd_comment"> <FilteredQuery></span>
126 <span class="dtd_comment"> <Query></span>
127 <span class="dtd_comment"> <UserQuery>bank</UserQuery></span>
128 <span class="dtd_comment"> </Query> </span>
129 <span class="dtd_comment"> <Filter></span>
130 <span class="dtd_comment"> <CachedFilter></span>
131 <span class="dtd_comment"> <RangeFilter fieldName="date" lowerTerm="19970101" upperTerm="20070101"/></span>
132 <span class="dtd_comment"> </CachedFilter></span>
133 <span class="dtd_comment"> </Filter> </span>
134 <span class="dtd_comment"> </FilteredQuery></span>
135 <span class="dtd_comment"> %</span>
136 <span class="dtd_comment"> </span>
137 <span class="dtd_comment"> --></span>
138 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">CachedFilter</span><span class="dtd_plain"> (%</span><span class="dtd_attribute_name">queries</span><span class="dtd_plain">;|%</span><span class="dtd_attribute_name">filters</span><span class="dtd_plain">;)</span><span class="dtd_tag_symbols">></span>
142 <span class="dtd_comment"><!--</span>
143 <span class="dtd_comment">Passes content directly through to the standard LuceneQuery parser see "Lucene Query Syntax"</span>
144 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> </span>
145 <span class="dtd_comment"> <em>Search for documents about John Smith or John Doe using standard LuceneQuerySyntax</em></span>
146 <span class="dtd_comment"> % </span>
147 <span class="dtd_comment"> <UserQuery>"John Smith" OR "John Doe"</UserQuery></span>
148 <span class="dtd_comment"> %</span>
149 <span class="dtd_comment"> </span>
150 <span class="dtd_comment">--></span>
151 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">UserQuery</span><span class="dtd_plain"> (</span><span class="dtd_keyword">#PCDATA</span><span class="dtd_plain">)</span><span class="dtd_tag_symbols">></span>
152 <span class="dtd_comment"><!-- Optional boost for matches on this query. Values > 1 --></span>
153 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">UserQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">boost</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"1.0"</span><span class="dtd_tag_symbols">></span>
154 <span class="dtd_comment"><!-- fieldName can optionally be defined here to change the default field used in the QueryParser --></span><span class="dtd_plain"> </span>
155 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">UserQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">fieldName</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#IMPLIED</span><span class="dtd_tag_symbols">></span>
157 <span class="dtd_comment"><!-- A query which is used to match all documents. This has a couple of uses: </span>
158 <span class="dtd_comment"> <ol></span>
159 <span class="dtd_comment"> <li> as a Clause in a BooleanQuery who's only other clause</span>
160 <span class="dtd_comment"> is a "mustNot" match (Lucene requires at least one positive clause) and..</li></span>
161 <span class="dtd_comment"> <li> in a FilteredQuery where a Filter tag is effectively being </span>
162 <span class="dtd_comment"> used to select content rather than it's usual role of filtering the results of a query.</li></span>
163 <span class="dtd_comment"> </ol></span>
164 <span class="dtd_comment"> </span>
165 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> </span>
166 <span class="dtd_comment"> <em>Effectively use a Filter as a query </em></span>
167 <span class="dtd_comment"> % </span>
168 <span class="dtd_comment"> <FilteredQuery></span>
169 <span class="dtd_comment"> <Query></span>
170 <span class="dtd_comment"> <MatchAllDocsQuery/></span>
171 <span class="dtd_comment"> </Query></span>
172 <span class="dtd_comment"> <Filter></span>
173 <span class="dtd_comment"> <RangeFilter fieldName="date" lowerTerm="19870409" upperTerm="19870412"/></span>
174 <span class="dtd_comment"> </Filter> </span>
175 <span class="dtd_comment"> </FilteredQuery> </span>
176 <span class="dtd_comment"> %</span>
177 <span class="dtd_comment"> </span>
178 <span class="dtd_comment">--></span>
179 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">MatchAllDocsQuery</span><span class="dtd_plain"> </span><span class="dtd_keyword">EMPTY</span><span class="dtd_tag_symbols">></span>
181 <span class="dtd_comment"><!-- a single term query - no analysis is done of the child text</span>
182 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> </span>
183 <span class="dtd_comment"> <em>Match on a primary key</em></span>
184 <span class="dtd_comment"> % </span>
185 <span class="dtd_comment"> <TermQuery fieldName="primaryKey">13424</TermQuery></span>
186 <span class="dtd_comment"> % </span>
187 <span class="dtd_comment">--></span><span class="dtd_plain"> </span>
188 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">TermQuery</span><span class="dtd_plain"> (</span><span class="dtd_keyword">#PCDATA</span><span class="dtd_plain">)</span><span class="dtd_tag_symbols">></span>
189 <span class="dtd_comment"><!-- Optional boost for matches on this query. Values > 1 --></span>
190 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">TermQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">boost</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"1.0"</span><span class="dtd_tag_symbols">></span>
191 <span class="dtd_comment"><!-- fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute --></span><span class="dtd_plain"> </span>
192 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">TermQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">fieldName</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#IMPLIED</span><span class="dtd_tag_symbols">></span>
195 <span class="dtd_comment"><!--</span>
196 <span class="dtd_comment"> A boosted term query - no analysis is done of the child text. Also a span member.</span>
198 <span class="dtd_comment"> (Text below is copied from the javadocs of BoostingTermQuery)</span>
199 <span class="dtd_comment"> </span>
200 <span class="dtd_comment"> The BoostingTermQuery is very similar to the {@link org.apache.lucene.search.spans.SpanTermQuery} except</span>
201 <span class="dtd_comment"> that it factors in the value of the payload located at each of the positions where the</span>
202 <span class="dtd_comment"> {@link org.apache.lucene.index.Term} occurs.</span>
204 <span class="dtd_comment"> In order to take advantage of this, you must override {@link org.apache.lucene.search.Similarity#scorePayload(String, byte[],int,int)}</span>
205 <span class="dtd_comment"> which returns 1 by default.</span>
207 <span class="dtd_comment"> Payload scores are averaged across term occurrences in the document.</span>
209 <span class="dtd_comment"> @see org.apache.lucene.search.Similarity#scorePayload(String, byte[], int, int)</span>
210 <span class="dtd_comment">--></span>
211 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">BoostingTermQuery</span><span class="dtd_plain"> (</span><span class="dtd_keyword">#PCDATA</span><span class="dtd_plain">)</span><span class="dtd_tag_symbols">></span>
212 <span class="dtd_comment"><!-- Optional boost for matches on this query. Values > 1 --></span>
213 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">TermQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">boost</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"1.0"</span><span class="dtd_tag_symbols">></span>
214 <span class="dtd_comment"><!-- fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute --></span>
215 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">TermQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">fieldName</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#IMPLIED</span><span class="dtd_tag_symbols">></span>
219 <span class="dtd_comment"><!-- </span>
220 <span class="dtd_comment"> The equivalent of a BooleanQuery with multiple optional TermQuery clauses.</span>
221 <span class="dtd_comment"> Child text is analyzed using a field-specific choice of Analyzer to produce a set of terms that are ORed together in Boolean logic.</span>
222 <span class="dtd_comment"> Unlike UserQuery element, this does not parse any special characters to control fuzzy/phrase/boolean logic and as such is incapable</span>
223 <span class="dtd_comment"> of producing a Query parse error given any user input</span>
224 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> </span>
225 <span class="dtd_comment"> <em>Match on text from a database description (which may contain characters that </span>
226 <span class="dtd_comment"> are illegal characters in the standard Lucene Query syntax used in the UserQuery tag</em></span>
227 <span class="dtd_comment"> % </span>
228 <span class="dtd_comment"> <TermsQuery fieldName="description">Smith & Sons (Ltd) : incorporated 1982</TermsQuery></span>
229 <span class="dtd_comment"> % </span>
230 <span class="dtd_comment">--></span><span class="dtd_plain"> </span>
231 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">TermsQuery</span><span class="dtd_plain"> (</span><span class="dtd_keyword">#PCDATA</span><span class="dtd_plain">)</span><span class="dtd_tag_symbols">></span>
232 <span class="dtd_comment"><!-- Optional boost for matches on this query. Values > 1 --></span>
233 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">TermsQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">boost</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"1.0"</span><span class="dtd_tag_symbols">></span>
234 <span class="dtd_comment"><!-- fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute --></span><span class="dtd_plain"> </span>
235 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">TermsQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">fieldName</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#IMPLIED</span><span class="dtd_tag_symbols">></span>
236 <span class="dtd_comment"><!-- The "Coordination factor" rewards documents that contain more of the terms in this list. This flag can be used to turn off this factor. --></span>
237 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">TermsQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">disableCoord</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">true</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">false</span><span class="dtd_plain">) </span><span class="dtd_attribute_value">"false"</span><span class="dtd_tag_symbols">></span>
238 <span class="dtd_comment"><!-- The minimum number of terms that should be present in any one document before it is considered to be a match. --></span>
239 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">TermsQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">minimumNumberShouldMatch</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"0"</span><span class="dtd_tag_symbols">></span>
242 <span class="dtd_comment"><!-- </span>
243 <span class="dtd_comment"> Runs a Query and filters results to only those query matches that also match the Filter element. </span>
244 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> </span>
245 <span class="dtd_comment"> <em>Find all documents about Lucene that have a status of "published"</em></span>
246 <span class="dtd_comment"> % </span>
247 <span class="dtd_comment"> <FilteredQuery></span>
248 <span class="dtd_comment"> <Query></span>
249 <span class="dtd_comment"> <UserQuery>Lucene</UserQuery></span>
250 <span class="dtd_comment"> </Query></span>
251 <span class="dtd_comment"> <Filter></span>
252 <span class="dtd_comment"> <TermsFilter fieldName="status">published</TermsFilter></span>
253 <span class="dtd_comment"> </Filter> </span>
254 <span class="dtd_comment"> </FilteredQuery> </span>
255 <span class="dtd_comment"> % </span>
256 <span class="dtd_comment">--></span><span class="dtd_plain"> </span>
257 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">FilteredQuery</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">Query</span><span class="dtd_plain">,</span><span class="dtd_attribute_name">Filter</span><span class="dtd_plain">)</span><span class="dtd_tag_symbols">></span>
258 <span class="dtd_comment"><!-- Optional boost for matches on this query. Values > 1 --></span>
259 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">FilteredQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">boost</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"1.0"</span><span class="dtd_tag_symbols">></span>
260 <span class="dtd_comment"><!-- Used to identify a nested Query element inside another container element. NOT a top-level query tag --></span>
261 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">Query</span><span class="dtd_plain"> (%</span><span class="dtd_attribute_name">queries</span><span class="dtd_plain">;)</span><span class="dtd_tag_symbols">></span>
262 <span class="dtd_comment"><!-- The choice of Filter that MUST also be matched --></span>
263 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">Filter</span><span class="dtd_plain"> (%</span><span class="dtd_attribute_name">filters</span><span class="dtd_plain">;)</span><span class="dtd_tag_symbols">></span>
265 <span class="dtd_comment"><!--</span>
266 <span class="dtd_comment"> Filter used to limit query results to documents matching a range of field values</span>
267 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> </span>
268 <span class="dtd_comment"> <em>Search for documents about banks from the last 10 years</em></span>
269 <span class="dtd_comment"> % </span>
270 <span class="dtd_comment"> <FilteredQuery></span>
271 <span class="dtd_comment"> <Query></span>
272 <span class="dtd_comment"> <UserQuery>bank</UserQuery></span>
273 <span class="dtd_comment"> </Query> </span>
274 <span class="dtd_comment"> <Filter></span>
275 <span class="dtd_comment"> <RangeFilter fieldName="date" lowerTerm="19970101" upperTerm="20070101"/></span>
276 <span class="dtd_comment"> </Filter> </span>
277 <span class="dtd_comment"> </FilteredQuery></span>
278 <span class="dtd_comment"> %</span>
279 <span class="dtd_comment"> --></span>
280 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">RangeFilter</span><span class="dtd_plain"> </span><span class="dtd_keyword">EMPTY</span><span class="dtd_tag_symbols">></span>
281 <span class="dtd_comment"><!-- fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute --></span><span class="dtd_plain"> </span>
282 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">RangeFilter</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">fieldName</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#IMPLIED</span><span class="dtd_tag_symbols">></span>
283 <span class="dtd_comment"><!-- The lower-most term value for this field (must be <= upperTerm) --></span>
284 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">RangeFilter</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">lowerTerm</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#REQUIRED</span><span class="dtd_tag_symbols">></span>
285 <span class="dtd_comment"><!-- The upper-most term value for this field (must be >= lowerTerm) --></span>
286 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">RangeFilter</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">upperTerm</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#REQUIRED</span><span class="dtd_tag_symbols">></span>
287 <span class="dtd_comment"><!-- Controls if the lowerTerm in the range is part of the allowed set of values --></span>
288 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">RangeFilter</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">includeLower</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">true</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">false</span><span class="dtd_plain">) </span><span class="dtd_attribute_value">"true"</span><span class="dtd_tag_symbols">></span>
289 <span class="dtd_comment"><!-- Controls if the upperTerm in the range is part of the allowed set of values --></span>
290 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">RangeFilter</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">includeUpper</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">true</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">false</span><span class="dtd_plain">) </span><span class="dtd_attribute_value">"true"</span><span class="dtd_tag_symbols">></span>
292 <span class="dtd_comment"><!--</span>
293 <span class="dtd_comment"> A Query that matches numeric values within a specified range.</span>
294 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> </span>
295 <span class="dtd_comment"> <em>Search for documents about people who are aged 20-25</em></span>
296 <span class="dtd_comment"> % </span>
297 <span class="dtd_comment"> <NumericRangeQuery fieldName="age" lowerTerm="20" upperTerm="25" /></span>
298 <span class="dtd_comment"> %</span>
299 <span class="dtd_comment"> --></span>
300 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeQuery</span><span class="dtd_plain"> </span><span class="dtd_keyword">EMPTY</span><span class="dtd_tag_symbols">></span>
301 <span class="dtd_comment"><!-- fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute --></span><span class="dtd_plain"> </span>
302 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">fieldName</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#IMPLIED</span><span class="dtd_tag_symbols">></span>
303 <span class="dtd_comment"><!-- The lower-most term value for this field (must be <= upperTerm and a valid native java numeric type) --></span>
304 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">lowerTerm</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#REQUIRED</span><span class="dtd_tag_symbols">></span>
305 <span class="dtd_comment"><!-- The upper-most term value for this field (must be >= lowerTerm and a valid native java numeric type) --></span>
306 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">upperTerm</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#REQUIRED</span><span class="dtd_tag_symbols">></span>
307 <span class="dtd_comment"><!-- The numeric type of this field --></span>
308 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">type</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">int</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">long</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">float</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">double</span><span class="dtd_plain">) </span><span class="dtd_attribute_value">"int"</span><span class="dtd_tag_symbols">></span>
309 <span class="dtd_comment"><!-- Controls if the lowerTerm in the range is part of the allowed set of values --></span>
310 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">includeLower</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">true</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">false</span><span class="dtd_plain">) </span><span class="dtd_attribute_value">"true"</span><span class="dtd_tag_symbols">></span>
311 <span class="dtd_comment"><!-- Controls if the upperTerm in the range is part of the allowed set of values --></span>
312 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">includeUpper</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">true</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">false</span><span class="dtd_plain">) </span><span class="dtd_attribute_value">"true"</span><span class="dtd_tag_symbols">></span>
313 <span class="dtd_comment"><!-- Lower step values mean more precisions and so more terms in index (and index gets larger). This value must be an integer --></span>
314 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">precisionStep</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"4"</span><span class="dtd_tag_symbols">></span>
316 <span class="dtd_comment"><!--</span>
317 <span class="dtd_comment"> A Filter that only accepts numeric values within a specified range</span>
318 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> </span>
319 <span class="dtd_comment"> <em>Search for documents about people who are aged 20-25</em></span>
320 <span class="dtd_comment"> % </span>
321 <span class="dtd_comment"> <FilteredQuery></span>
322 <span class="dtd_comment"> <Query></span>
323 <span class="dtd_comment"> <UserQuery>person</UserQuery></span>
324 <span class="dtd_comment"> </Query> </span>
325 <span class="dtd_comment"> <Filter></span>
326 <span class="dtd_comment"> <NumericRangeFilter fieldName="age" lowerTerm="20" upperTerm="25"/></span>
327 <span class="dtd_comment"> </Filter> </span>
328 <span class="dtd_comment"> </FilteredQuery></span>
329 <span class="dtd_comment"> %</span>
330 <span class="dtd_comment"> --></span>
331 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeFilter</span><span class="dtd_plain"> </span><span class="dtd_keyword">EMPTY</span><span class="dtd_tag_symbols">></span>
332 <span class="dtd_comment"><!-- fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute --></span><span class="dtd_plain"> </span>
333 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeFilter</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">fieldName</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#IMPLIED</span><span class="dtd_tag_symbols">></span>
334 <span class="dtd_comment"><!-- The lower-most term value for this field (must be <= upperTerm and a valid native java numeric type) --></span>
335 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeFilter</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">lowerTerm</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#REQUIRED</span><span class="dtd_tag_symbols">></span>
336 <span class="dtd_comment"><!-- The upper-most term value for this field (must be >= lowerTerm and a valid native java numeric type) --></span>
337 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeFilter</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">upperTerm</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#REQUIRED</span><span class="dtd_tag_symbols">></span>
338 <span class="dtd_comment"><!-- The numeric type of this field --></span>
339 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeFilter</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">type</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">int</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">long</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">float</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">double</span><span class="dtd_plain">) </span><span class="dtd_attribute_value">"int"</span><span class="dtd_tag_symbols">></span>
340 <span class="dtd_comment"><!-- Controls if the lowerTerm in the range is part of the allowed set of values --></span>
341 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeFilter</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">includeLower</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">true</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">false</span><span class="dtd_plain">) </span><span class="dtd_attribute_value">"true"</span><span class="dtd_tag_symbols">></span>
342 <span class="dtd_comment"><!-- Controls if the upperTerm in the range is part of the allowed set of values --></span>
343 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeFilter</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">includeUpper</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">true</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">false</span><span class="dtd_plain">) </span><span class="dtd_attribute_value">"true"</span><span class="dtd_tag_symbols">></span>
344 <span class="dtd_comment"><!-- Lower step values mean more precisions and so more terms in index (and index gets larger). This value must be an integer --></span>
345 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">NumericRangeFilter</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">precisionStep</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"4"</span><span class="dtd_tag_symbols">></span>
347 <span class="dtd_comment"><!-- A single term used in a SpanQuery. These clauses are the building blocks for more complex "span" queries which test word proximity</span>
348 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> <em>Find documents using terms close to each other about mining and accidents</em></span>
349 <span class="dtd_comment"> %</span>
350 <span class="dtd_comment"> <SpanNear slop="8" inOrder="false" fieldName="text"> </span>
351 <span class="dtd_comment"> <SpanOr></span>
352 <span class="dtd_comment"> <SpanTerm>killed</SpanTerm></span>
353 <span class="dtd_comment"> <SpanTerm>died</SpanTerm></span>
354 <span class="dtd_comment"> <SpanTerm>dead</SpanTerm></span>
355 <span class="dtd_comment"> </SpanOr></span>
356 <span class="dtd_comment"> <SpanOr></span>
357 <span class="dtd_comment"> <SpanTerm>miner</SpanTerm></span>
358 <span class="dtd_comment"> <SpanTerm>mining</SpanTerm></span>
359 <span class="dtd_comment"> <SpanTerm>miners</SpanTerm></span>
360 <span class="dtd_comment"> </SpanOr></span>
361 <span class="dtd_comment"> </SpanNear></span>
362 <span class="dtd_comment"> % </span>
363 <span class="dtd_comment"> --></span>
364 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">SpanTerm</span><span class="dtd_plain"> (</span><span class="dtd_keyword">#PCDATA</span><span class="dtd_plain">)</span><span class="dtd_tag_symbols">></span>
365 <span class="dtd_comment"><!-- fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute --></span><span class="dtd_plain"> </span>
366 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">SpanTerm</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">fieldName</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#REQUIRED</span><span class="dtd_tag_symbols">></span>
368 <span class="dtd_comment"><!-- A field-specific analyzer is used here to parse the child text provided in this tag. The SpanTerms produced are ORed in terms of Boolean logic </span>
369 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> <em>Use SpanOrTerms as a more convenient/succinct way of expressing multiple choices of SpanTerms. This example looks for reports </span>
370 <span class="dtd_comment"> using words describing a fatality near to references to miners</em></span>
371 <span class="dtd_comment"> %</span>
372 <span class="dtd_comment"> <SpanNear slop="8" inOrder="false" fieldName="text"> </span>
373 <span class="dtd_comment"> <SpanOrTerms>killed died death dead deaths</SpanOrTerms></span>
374 <span class="dtd_comment"> <SpanOrTerms>miner mining miners</SpanOrTerms></span>
375 <span class="dtd_comment"> </SpanNear></span>
376 <span class="dtd_comment"> % </span>
377 <span class="dtd_comment"> --></span>
378 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">SpanOrTerms</span><span class="dtd_plain"> (</span><span class="dtd_keyword">#PCDATA</span><span class="dtd_plain">)</span><span class="dtd_tag_symbols">></span>
379 <span class="dtd_comment"><!-- fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute --></span><span class="dtd_plain"> </span>
380 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">SpanOrTerms</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">fieldName</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#REQUIRED</span><span class="dtd_tag_symbols">></span>
382 <span class="dtd_comment"><!-- Takes any number of child queries from the Span family </span>
383 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> <em>Find documents using terms close to each other about mining and accidents</em></span>
384 <span class="dtd_comment"> %</span>
385 <span class="dtd_comment"> <SpanNear slop="8" inOrder="false" fieldName="text"> </span>
386 <span class="dtd_comment"> <SpanOr></span>
387 <span class="dtd_comment"> <SpanTerm>killed</SpanTerm></span>
388 <span class="dtd_comment"> <SpanTerm>died</SpanTerm></span>
389 <span class="dtd_comment"> <SpanTerm>dead</SpanTerm></span>
390 <span class="dtd_comment"> </SpanOr></span>
391 <span class="dtd_comment"> <SpanOr></span>
392 <span class="dtd_comment"> <SpanTerm>miner</SpanTerm></span>
393 <span class="dtd_comment"> <SpanTerm>mining</SpanTerm></span>
394 <span class="dtd_comment"> <SpanTerm>miners</SpanTerm></span>
395 <span class="dtd_comment"> </SpanOr></span>
396 <span class="dtd_comment"> </SpanNear></span>
397 <span class="dtd_comment"> % </span>
398 <span class="dtd_comment"> </span>
399 <span class="dtd_comment"> --></span>
400 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">SpanOr</span><span class="dtd_plain"> (%</span><span class="dtd_attribute_name">spanQueries</span><span class="dtd_plain">;)* </span><span class="dtd_tag_symbols">></span>
402 <span class="dtd_comment"><!-- Takes any number of child queries from the Span family and tests for proximity</span>
403 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@hidden</span><span class="dtd_comment"> TODO SpanNear missing "boost attr (could add to SpanBuilderBase)</span>
404 <span class="dtd_comment"> --></span>
405 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">SpanNear</span><span class="dtd_plain"> (%</span><span class="dtd_attribute_name">spanQueries</span><span class="dtd_plain">;)* </span><span class="dtd_tag_symbols">></span>
406 <span class="dtd_comment"><!-- defines the maximum distance between Span elements where distance is expressed as word number, not byte offset </span>
407 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> <em>Find documents using terms within 8 words of each other talking about mining and accidents</em></span>
408 <span class="dtd_comment"> %</span>
409 <span class="dtd_comment"> <SpanNear slop="8" inOrder="false" fieldName="text"> </span>
410 <span class="dtd_comment"> <SpanOr></span>
411 <span class="dtd_comment"> <SpanTerm>killed</SpanTerm></span>
412 <span class="dtd_comment"> <SpanTerm>died</SpanTerm></span>
413 <span class="dtd_comment"> <SpanTerm>dead</SpanTerm></span>
414 <span class="dtd_comment"> </SpanOr></span>
415 <span class="dtd_comment"> <SpanOr></span>
416 <span class="dtd_comment"> <SpanTerm>miner</SpanTerm></span>
417 <span class="dtd_comment"> <SpanTerm>mining</SpanTerm></span>
418 <span class="dtd_comment"> <SpanTerm>miners</SpanTerm></span>
419 <span class="dtd_comment"> </SpanOr></span>
420 <span class="dtd_comment"> </SpanNear></span>
421 <span class="dtd_comment"> % </span>
422 <span class="dtd_comment"> --></span>
423 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">SpanNear</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">slop</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#REQUIRED</span><span class="dtd_tag_symbols">></span>
424 <span class="dtd_comment"><!-- Controls if matching terms have to appear in the order listed or can be reversed --></span>
425 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">SpanNear</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">inOrder</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">true</span><span class="dtd_plain"> | </span><span class="dtd_attribute_name">false</span><span class="dtd_plain">) </span><span class="dtd_attribute_value">"true"</span><span class="dtd_tag_symbols">></span>
427 <span class="dtd_comment"><!-- Looks for a SpanQuery match occuring near the beginning of a document</span>
428 <span class="dtd_comment"> </span>
429 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> </span>
430 <span class="dtd_comment"> <em>Find letters where the first 50 words talk about a resignation:</em></span>
431 <span class="dtd_comment"> % </span>
432 <span class="dtd_comment"> <SpanFirst end="50"></span>
433 <span class="dtd_comment"> <SpanOrTerms fieldName="text">resigning resign leave</SpanOrTerms></span>
434 <span class="dtd_comment"> </SpanFirst></span>
435 <span class="dtd_comment"> %</span>
436 <span class="dtd_comment"> </span>
437 <span class="dtd_comment"> --></span><span class="dtd_plain"> </span>
438 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">SpanFirst</span><span class="dtd_plain"> (%</span><span class="dtd_attribute_name">spanQueries</span><span class="dtd_plain">;) </span><span class="dtd_tag_symbols">></span>
439 <span class="dtd_comment"><!-- Controls the end of the region considered in a document's field (expressed in word number, not byte offset) --></span><span class="dtd_plain"> </span>
440 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">SpanFirst</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">end</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_keyword">#REQUIRED</span><span class="dtd_tag_symbols">></span>
441 <span class="dtd_comment"><!-- Optional boost for matches on this query. Values > 1 --></span>
442 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">SpanFirst</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">boost</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"1.0"</span><span class="dtd_tag_symbols">></span>
444 <span class="dtd_comment"><!-- Finds documents matching a SpanQuery but not if matching another SpanQuery </span>
445 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> <em>Find documents talking about social services but not containing the word "public"</em></span>
446 <span class="dtd_comment"> %</span>
447 <span class="dtd_comment"> <SpanNot fieldName="text"></span>
448 <span class="dtd_comment"> <Include></span>
449 <span class="dtd_comment"> <SpanNear slop="2" inOrder="true"> </span>
450 <span class="dtd_comment"> <SpanTerm>social</SpanTerm></span>
451 <span class="dtd_comment"> <SpanTerm>services</SpanTerm></span>
452 <span class="dtd_comment"> </SpanNear> </span>
453 <span class="dtd_comment"> </Include></span>
454 <span class="dtd_comment"> <Exclude></span>
455 <span class="dtd_comment"> <SpanTerm>public</SpanTerm></span>
456 <span class="dtd_comment"> </Exclude></span>
457 <span class="dtd_comment"> </SpanNot></span>
458 <span class="dtd_comment"> % </span>
459 <span class="dtd_comment"> </span>
460 <span class="dtd_comment"> --></span>
461 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">SpanNot</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">Include</span><span class="dtd_plain">,</span><span class="dtd_attribute_name">Exclude</span><span class="dtd_plain">) </span><span class="dtd_tag_symbols">></span>
462 <span class="dtd_comment"><!-- The SpanQuery to find --></span>
463 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">Include</span><span class="dtd_plain"> (%</span><span class="dtd_attribute_name">spanQueries</span><span class="dtd_plain">;) </span><span class="dtd_tag_symbols">></span>
464 <span class="dtd_comment"><!-- The SpanQuery to be avoided --></span>
465 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">Exclude</span><span class="dtd_plain"> (%</span><span class="dtd_attribute_name">spanQueries</span><span class="dtd_plain">;) </span><span class="dtd_tag_symbols">></span>
468 <span class="dtd_comment"><!-- a utility tag to wrap any filter as a query </span>
469 <span class="dtd_comment"> </span><span class="dtd_dtddoc_tag">@example</span><span class="dtd_comment"> <em> Find all documents from the last 10 years </em></span>
470 <span class="dtd_comment"> %</span>
471 <span class="dtd_comment"> <ConstantScoreQuery></span>
472 <span class="dtd_comment"> <RangeFilter fieldName="date" lowerTerm="19970101" upperTerm="20070101"/></span>
473 <span class="dtd_comment"> </ConstantScoreQuery> </span>
474 <span class="dtd_comment"> %</span>
475 <span class="dtd_comment"> --></span>
476 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">ConstantScoreQuery</span><span class="dtd_plain"> (%</span><span class="dtd_attribute_name">filters</span><span class="dtd_plain">;)* </span><span class="dtd_tag_symbols">></span>
477 <span class="dtd_comment"><!-- Optional boost for matches on this query. Values > 1 --></span>
478 <span class="dtd_tag_symbols"><!</span><span class="dtd_tag_name">ATTLIST</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">ConstantScoreQuery</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">boost</span><span class="dtd_plain"> </span><span class="dtd_keyword">CDATA</span><span class="dtd_plain"> </span><span class="dtd_attribute_value">"1.0"</span><span class="dtd_tag_symbols">></span>