1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html><head> 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>Contrib Lucene</title> 6</head><body> 7<p class='DTDSource'><b><code>LuceneContribQuery.dtd</code></b>: <a href='LuceneContribQuery.dtd.html'>Elements</a> - <a href='LuceneContribQuery.dtd.entities.html'>Entities</a> - <a href='LuceneContribQuery.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='LuceneContribQuery.dtd.html' target='_top'>NO FRAMES</a></p><h1>Contrib Lucene</h1> 8<p>This DTD builds on the <a href="LuceneCoreQuery.dtd.html">core Lucene XML syntax</a> and adds support for features found in the "contrib" section of the Lucene project.</p><p>CorePlusExtensionsParser.java is the Java class that encapsulates this parser behaviour.</p><p>The features added are: 9<ul> 10<li><a href="#LikeThisQuery">LikeThisQuery</a></li> 11Support for querying using large amounts of example text indicative of the users' general area of interest 12<li><a href="#FuzzyLikeThisQuery">FuzzyLikeThisQuery</a></li> 13A style of fuzzy query which automatically looks for fuzzy variations on only the "interesting" terms 14<li><a href="#BooleanFilter">BooleanFilter</a></li> 15Is to Filters what core Lucene's BooleanQuery is to Queries - allows mixing of clauses using Boolean logic 16<li><a href="#TermsFilter">TermsFilter</a></li> 17Constructs a filter from an arbitrary set of terms (unlike <a href="#RangeFilter">RangeFilter</a> which requires a contiguous range of terms) 18<li><a href="#DuplicateFilter">DuplicateFilter</a></li> 19Removes duplicated documents from results where "duplicate" means documents share a value for a particular field (e.g. a primary key) 20<li><a href="#BoostingQuery">BoostingQuery</a></li> 21Influence score of a query's matches in a subtle way which can't be achieved using BooleanQuery 22</ul></p><br /> 23<a name='BooleanQuery'></a> 24<br /><table class='elementTitle' summary="BooleanQuery"><tr><td class='leftElementTitle'> 25<BooleanQuery></td><td class='rightElementTitle'> 26Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a> 27</td></tr></table> 28<p>BooleanQuerys implement Boolean logic which controls how multiple Clauses should be interpreted. 29Some clauses may represent optional Query criteria while others represent mandatory criteria.</p><p><span class='inTextTitle'>Example:</span> <em>Find articles about banks, preferably talking about mergers but nothing to do with "sumitomo"</em> 30</p><pre> 31 <BooleanQuery fieldName="contents"> 32 <Clause occurs="should"> 33 <TermQuery>merger</TermQuery> 34 </Clause> 35 <Clause occurs="mustnot"> 36 <TermQuery>sumitomo</TermQuery> 37 </Clause> 38 <Clause occurs="must"> 39 <TermQuery>bank</TermQuery> 40 </Clause> 41 </BooleanQuery> 42 43 </pre><p></p><blockquote><table summary='element info'><tr> 44<td class='construct'><table summary="<BooleanQuery>'s children"> 45<thead> 46<tr><th class='title' colspan='2'><BooleanQuery>'s children</th></tr> 47<tr><th colspan='2' height='1' class='ruler'></th></tr> 48<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 49<tr><th colspan='2' height='1' class='ruler'></th></tr> 50</thead> 51<tbody><tr><td><a href='#Clause'>Clause</a></td><td>At least one</td></tr> 52</tbody></table></td><td class='construct'><table summary="<BooleanQuery>'s attributes"><tr> 53<th class='title' colspan='3'><BooleanQuery>'s attributes</th> 54</tr> 55<tr><th colspan='3' height='1' class='ruler'></th></tr> 56<tr> 57<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 58<tr><th colspan='3' height='1' class='ruler'></th></tr> 59<tr><td><a href='#BooleanQuery_boost'>boost</a></td><td></td><td>1.0</td></tr><tr><td><a href='#BooleanQuery_disableCoord'>disableCoord</a></td><td>true, false</td><td>false</td></tr><tr><td><a href='#BooleanQuery_fieldName'>fieldName</a></td><td></td><td></td></tr><tr><td><a href='#BooleanQuery_minimumNumberShouldMatch'>minimumNumberShouldMatch</a></td><td></td><td>0</td></tr></table></td></tr></table></blockquote> 60<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#Clause'>Clause</a>)+</p><a name='BooleanQuery_boost'></a> 61<br /><table class='attributeTitle' summary="boost"><tr><td class='leftAttributeTitle'> 62@boost</td><td class='rightAttributeTitle'> 63Attribute of <a href='#BooleanQuery'>BooleanQuery</a> 64</td></tr></table> 65<p>Optional boost for matches on this query. Values > 1</p><p><span class='inTextTitle'>Default value</span>: 1.0</p><a name='BooleanQuery_fieldName'></a> 66<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 67@fieldName</td><td class='rightAttributeTitle'> 68Attribute of <a href='#BooleanQuery'>BooleanQuery</a> 69</td></tr></table> 70<p>fieldName can optionally be defined here as a default attribute used by all child elements</p><a name='BooleanQuery_disableCoord'></a> 71<br /><table class='attributeTitle' summary="disableCoord"><tr><td class='leftAttributeTitle'> 72@disableCoord</td><td class='rightAttributeTitle'> 73Attribute of <a href='#BooleanQuery'>BooleanQuery</a> 74</td></tr></table> 75<p>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.</p><p><span class='inTextTitle'>Possible values</span>: true, false - <span class='inTextTitle'>Default value</span>: false</p><a name='BooleanQuery_minimumNumberShouldMatch'></a> 76<br /><table class='attributeTitle' summary="minimumNumberShouldMatch"><tr><td class='leftAttributeTitle'> 77@minimumNumberShouldMatch</td><td class='rightAttributeTitle'> 78Attribute of <a href='#BooleanQuery'>BooleanQuery</a> 79</td></tr></table> 80<p>The minimum number of optional clauses that should be present in any one document before it is considered to be a match.</p><p><span class='inTextTitle'>Default value</span>: 0</p><a name='Clause'></a> 81<br /><table class='elementTitle' summary="Clause"><tr><td class='leftElementTitle'> 82<Clause></td><td class='rightElementTitle'> 83Child of <a href='#BooleanFilter'>BooleanFilter</a>, <a href='#BooleanQuery'>BooleanQuery</a> 84</td></tr></table> 85<p>NOTE: "Clause" tag has 2 modes of use - inside <BooleanQuery> in which case only "query" types can be 86child elements - while in a <BooleanFilter> clause only "filter" types can be contained.</p><blockquote><table summary='element info'><tr> 87<td class='construct'><table summary="<Clause>'s children"> 88<thead> 89<tr><th class='title' colspan='2'><Clause>'s children</th></tr> 90<tr><th colspan='2' height='1' class='ruler'></th></tr> 91<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 92<tr><th colspan='2' height='1' class='ruler'></th></tr> 93</thead> 94<tbody><tr><td><a href='#BooleanFilter'>BooleanFilter</a></td><td>One or none</td></tr> 95<tr><td><a href='#BooleanQuery'>BooleanQuery</a></td><td>One or none</td></tr> 96<tr><td><a href='#BoostingQuery'>BoostingQuery</a></td><td>One or none</td></tr> 97<tr><td><a href='#BoostingTermQuery'>BoostingTermQuery</a></td><td>One or none</td></tr> 98<tr><td><a href='#CachedFilter'>CachedFilter</a></td><td>One or none</td></tr> 99<tr><td><a href='#ConstantScoreQuery'>ConstantScoreQuery</a></td><td>One or none</td></tr> 100<tr><td><a href='#DuplicateFilter'>DuplicateFilter</a></td><td>One or none</td></tr> 101<tr><td><a href='#FilteredQuery'>FilteredQuery</a></td><td>One or none</td></tr> 102<tr><td><a href='#FuzzyLikeThisQuery'>FuzzyLikeThisQuery</a></td><td>One or none</td></tr> 103<tr><td><a href='#LikeThisQuery'>LikeThisQuery</a></td><td>One or none</td></tr> 104<tr><td><a href='#MatchAllDocsQuery'>MatchAllDocsQuery</a></td><td>One or none</td></tr> 105<tr><td><a href='#NumericRangeFilter'>NumericRangeFilter</a></td><td>One or none</td></tr> 106<tr><td><a href='#NumericRangeQuery'>NumericRangeQuery</a></td><td>One or none</td></tr> 107<tr><td><a href='#RangeFilter'>RangeFilter</a></td><td>One or none</td></tr> 108<tr><td><a href='#SpanFirst'>SpanFirst</a></td><td>One or none</td></tr> 109<tr><td><a href='#SpanNear'>SpanNear</a></td><td>One or none</td></tr> 110<tr><td><a href='#SpanNot'>SpanNot</a></td><td>One or none</td></tr> 111<tr><td><a href='#SpanOr'>SpanOr</a></td><td>One or none</td></tr> 112<tr><td><a href='#SpanOrTerms'>SpanOrTerms</a></td><td>One or none</td></tr> 113<tr><td><a href='#SpanTerm'>SpanTerm</a></td><td>One or none</td></tr> 114<tr><td><a href='#TermQuery'>TermQuery</a></td><td>One or none</td></tr> 115<tr><td><a href='#TermsFilter'>TermsFilter</a></td><td>One or none</td></tr> 116<tr><td><a href='#TermsQuery'>TermsQuery</a></td><td>One or none</td></tr> 117<tr><td><a href='#UserQuery'>UserQuery</a></td><td>One or none</td></tr> 118</tbody></table></td><td class='construct'><table summary="<Clause>'s attributes"><tr> 119<th class='title' colspan='3'><Clause>'s attributes</th> 120</tr> 121<tr><th colspan='3' height='1' class='ruler'></th></tr> 122<tr> 123<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 124<tr><th colspan='3' height='1' class='ruler'></th></tr> 125<tr><td><a href='#Clause_occurs'>occurs</a></td><td>should, must, mustnot</td><td>should</td></tr></table></td></tr></table></blockquote> 126<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#BooleanQuery'>BooleanQuery</a> | <a href='#UserQuery'>UserQuery</a> | <a href='#FilteredQuery'>FilteredQuery</a> | <a href='#TermQuery'>TermQuery</a> | <a href='#TermsQuery'>TermsQuery</a> | <a href='#MatchAllDocsQuery'>MatchAllDocsQuery</a> | <a href='#ConstantScoreQuery'>ConstantScoreQuery</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a> | <a href='#NumericRangeQuery'>NumericRangeQuery</a> | <a href='#SpanOr'>SpanOr</a> | <a href='#SpanNear'>SpanNear</a> | <a href='#SpanOrTerms'>SpanOrTerms</a> | <a href='#SpanFirst'>SpanFirst</a> | <a href='#SpanNot'>SpanNot</a> | <a href='#SpanTerm'>SpanTerm</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a> | <a href='#LikeThisQuery'>LikeThisQuery</a> | <a href='#BoostingQuery'>BoostingQuery</a> | <a href='#FuzzyLikeThisQuery'>FuzzyLikeThisQuery</a> | <a href='#RangeFilter'>RangeFilter</a> | <a href='#NumericRangeFilter'>NumericRangeFilter</a> | <a href='#CachedFilter'>CachedFilter</a> | <a href='#TermsFilter'>TermsFilter</a> | <a href='#BooleanFilter'>BooleanFilter</a> | <a href='#DuplicateFilter'>DuplicateFilter</a>)</p><a name='Clause_occurs'></a> 127<br /><table class='attributeTitle' summary="occurs"><tr><td class='leftAttributeTitle'> 128@occurs</td><td class='rightAttributeTitle'> 129Attribute of <a href='#Clause'>Clause</a> 130</td></tr></table> 131<p>Controls if the clause is optional (should), mandatory (must) or unacceptable (mustNot)</p><p><span class='inTextTitle'>Possible values</span>: should, must, mustnot - <span class='inTextTitle'>Default value</span>: should</p><a name='CachedFilter'></a> 132<br /><table class='elementTitle' summary="CachedFilter"><tr><td class='leftElementTitle'> 133<CachedFilter></td><td class='rightElementTitle'> 134Child of <a href='#Clause'>Clause</a>, <a href='#Filter'>Filter</a>, <a href='#ConstantScoreQuery'>ConstantScoreQuery</a> 135</td></tr></table> 136<p>Caches any nested query or filter in an LRU (Least recently used) Cache. Cached queries, like filters, are turned into 137Bitsets at a cost of 1 bit per document in the index. The memory cost of a cached query/filter is therefore numberOfDocsinIndex/8 bytes. 138Queries that are cached as filters obviously retain none of the scoring information associated with results - they retain just 139a Boolean yes/no record of which documents matched.</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about banks from the last 10 years - caching the commonly-used "last 10 year" filter as a BitSet in 140RAM to eliminate the cost of building this filter from disk for every query</em> 141</p><pre> 142 <FilteredQuery> 143 <Query> 144 <UserQuery>bank</UserQuery> 145 </Query> 146 <Filter> 147 <CachedFilter> 148 <RangeFilter fieldName="date" lowerTerm="19970101" upperTerm="20070101"/> 149 </CachedFilter> 150 </Filter> 151 </FilteredQuery> 152 </pre><p></p><blockquote><table summary='element info'><tr> 153<td class='construct'><table summary="<CachedFilter>'s children"> 154<thead> 155<tr><th class='title' colspan='2'><CachedFilter>'s children</th></tr> 156<tr><th colspan='2' height='1' class='ruler'></th></tr> 157<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 158<tr><th colspan='2' height='1' class='ruler'></th></tr> 159</thead> 160<tbody><tr><td><a href='#BooleanFilter'>BooleanFilter</a></td><td>One or none</td></tr> 161<tr><td><a href='#BooleanQuery'>BooleanQuery</a></td><td>One or none</td></tr> 162<tr><td><a href='#BoostingQuery'>BoostingQuery</a></td><td>One or none</td></tr> 163<tr><td><a href='#BoostingTermQuery'>BoostingTermQuery</a></td><td>One or none</td></tr> 164<tr><td><a href='#CachedFilter'>CachedFilter</a></td><td>One or none</td></tr> 165<tr><td><a href='#ConstantScoreQuery'>ConstantScoreQuery</a></td><td>One or none</td></tr> 166<tr><td><a href='#DuplicateFilter'>DuplicateFilter</a></td><td>One or none</td></tr> 167<tr><td><a href='#FilteredQuery'>FilteredQuery</a></td><td>One or none</td></tr> 168<tr><td><a href='#FuzzyLikeThisQuery'>FuzzyLikeThisQuery</a></td><td>One or none</td></tr> 169<tr><td><a href='#LikeThisQuery'>LikeThisQuery</a></td><td>One or none</td></tr> 170<tr><td><a href='#MatchAllDocsQuery'>MatchAllDocsQuery</a></td><td>One or none</td></tr> 171<tr><td><a href='#NumericRangeFilter'>NumericRangeFilter</a></td><td>One or none</td></tr> 172<tr><td><a href='#NumericRangeQuery'>NumericRangeQuery</a></td><td>One or none</td></tr> 173<tr><td><a href='#RangeFilter'>RangeFilter</a></td><td>One or none</td></tr> 174<tr><td><a href='#SpanFirst'>SpanFirst</a></td><td>One or none</td></tr> 175<tr><td><a href='#SpanNear'>SpanNear</a></td><td>One or none</td></tr> 176<tr><td><a href='#SpanNot'>SpanNot</a></td><td>One or none</td></tr> 177<tr><td><a href='#SpanOr'>SpanOr</a></td><td>One or none</td></tr> 178<tr><td><a href='#SpanOrTerms'>SpanOrTerms</a></td><td>One or none</td></tr> 179<tr><td><a href='#SpanTerm'>SpanTerm</a></td><td>One or none</td></tr> 180<tr><td><a href='#TermQuery'>TermQuery</a></td><td>One or none</td></tr> 181<tr><td><a href='#TermsFilter'>TermsFilter</a></td><td>One or none</td></tr> 182<tr><td><a href='#TermsQuery'>TermsQuery</a></td><td>One or none</td></tr> 183<tr><td><a href='#UserQuery'>UserQuery</a></td><td>One or none</td></tr> 184</tbody></table></td></tr></table></blockquote> 185<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#BooleanQuery'>BooleanQuery</a> | <a href='#UserQuery'>UserQuery</a> | <a href='#FilteredQuery'>FilteredQuery</a> | <a href='#TermQuery'>TermQuery</a> | <a href='#TermsQuery'>TermsQuery</a> | <a href='#MatchAllDocsQuery'>MatchAllDocsQuery</a> | <a href='#ConstantScoreQuery'>ConstantScoreQuery</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a> | <a href='#NumericRangeQuery'>NumericRangeQuery</a> | <a href='#SpanOr'>SpanOr</a> | <a href='#SpanNear'>SpanNear</a> | <a href='#SpanOrTerms'>SpanOrTerms</a> | <a href='#SpanFirst'>SpanFirst</a> | <a href='#SpanNot'>SpanNot</a> | <a href='#SpanTerm'>SpanTerm</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a> | <a href='#LikeThisQuery'>LikeThisQuery</a> | <a href='#BoostingQuery'>BoostingQuery</a> | <a href='#FuzzyLikeThisQuery'>FuzzyLikeThisQuery</a> | <a href='#RangeFilter'>RangeFilter</a> | <a href='#NumericRangeFilter'>NumericRangeFilter</a> | <a href='#CachedFilter'>CachedFilter</a> | <a href='#TermsFilter'>TermsFilter</a> | <a href='#BooleanFilter'>BooleanFilter</a> | <a href='#DuplicateFilter'>DuplicateFilter</a>)</p><a name='UserQuery'></a> 186<br /><table class='elementTitle' summary="UserQuery"><tr><td class='leftElementTitle'> 187<UserQuery></td><td class='rightElementTitle'> 188Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a> 189</td></tr></table> 190<p>Passes content directly through to the standard LuceneQuery parser see "Lucene Query Syntax"</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about John Smith or John Doe using standard LuceneQuerySyntax</em> 191</p><pre> 192 <UserQuery>"John Smith" OR "John Doe"</UserQuery> 193 </pre><p></p><blockquote><table summary='element info'><tr> 194<td class='construct'><table summary="<UserQuery>'s attributes"><tr> 195<th class='title' colspan='3'><UserQuery>'s attributes</th> 196</tr> 197<tr><th colspan='3' height='1' class='ruler'></th></tr> 198<tr> 199<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 200<tr><th colspan='3' height='1' class='ruler'></th></tr> 201<tr><td><a href='#UserQuery_boost'>boost</a></td><td></td><td>1.0</td></tr><tr><td><a href='#UserQuery_fieldName'>fieldName</a></td><td></td><td></td></tr></table></td></tr></table></blockquote> 202<a name='UserQuery_boost'></a> 203<br /><table class='attributeTitle' summary="boost"><tr><td class='leftAttributeTitle'> 204@boost</td><td class='rightAttributeTitle'> 205Attribute of <a href='#UserQuery'>UserQuery</a> 206</td></tr></table> 207<p>Optional boost for matches on this query. Values > 1</p><p><span class='inTextTitle'>Default value</span>: 1.0</p><a name='UserQuery_fieldName'></a> 208<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 209@fieldName</td><td class='rightAttributeTitle'> 210Attribute of <a href='#UserQuery'>UserQuery</a> 211</td></tr></table> 212<p>fieldName can optionally be defined here to change the default field used in the QueryParser</p><a name='MatchAllDocsQuery'></a> 213<br /><table class='elementTitle' summary="MatchAllDocsQuery"><tr><td class='leftElementTitle'> 214<MatchAllDocsQuery/></td><td class='rightElementTitle'> 215Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a> 216</td></tr></table> 217<p>A query which is used to match all documents. This has a couple of uses: 218<ol> 219<li> as a Clause in a BooleanQuery who's only other clause 220is a "mustNot" match (Lucene requires at least one positive clause) and..</li> 221<li> in a FilteredQuery where a Filter tag is effectively being 222used to select content rather than its usual role of filtering the results of a query.</li> 223</ol></p><p><span class='inTextTitle'>Example:</span> <em>Effectively use a Filter as a query </em> 224</p><pre> 225 <FilteredQuery> 226 <Query> 227 <MatchAllDocsQuery/> 228 </Query> 229 <Filter> 230 <RangeFilter fieldName="date" lowerTerm="19870409" upperTerm="19870412"/> 231 </Filter> 232 </FilteredQuery> 233 </pre><p></p><p class='emptyTagNote'>This element is always empty.</p><a name='TermQuery'></a> 234<br /><table class='elementTitle' summary="TermQuery"><tr><td class='leftElementTitle'> 235<TermQuery></td><td class='rightElementTitle'> 236Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a> 237</td></tr></table> 238<p>a single term query - no analysis is done of the child text</p><p><span class='inTextTitle'>Example:</span> <em>Match on a primary key</em> 239</p><pre> 240 <TermQuery fieldName="primaryKey">13424</TermQuery> 241 </pre><p></p><blockquote><table summary='element info'><tr> 242<td class='construct'><table summary="<TermQuery>'s attributes"><tr> 243<th class='title' colspan='3'><TermQuery>'s attributes</th> 244</tr> 245<tr><th colspan='3' height='1' class='ruler'></th></tr> 246<tr> 247<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 248<tr><th colspan='3' height='1' class='ruler'></th></tr> 249<tr><td><a href='#TermQuery_boost'>boost</a></td><td></td><td>1.0</td></tr><tr><td><a href='#TermQuery_fieldName'>fieldName</a></td><td></td><td></td></tr></table></td></tr></table></blockquote> 250<a name='TermQuery_boost'></a> 251<br /><table class='attributeTitle' summary="boost"><tr><td class='leftAttributeTitle'> 252@boost</td><td class='rightAttributeTitle'> 253Attribute of <a href='#TermQuery'>TermQuery</a> 254</td></tr></table> 255<p>Optional boost for matches on this query. Values > 1</p><p><span class='inTextTitle'>Default value</span>: 1.0</p><a name='TermQuery_fieldName'></a> 256<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 257@fieldName</td><td class='rightAttributeTitle'> 258Attribute of <a href='#TermQuery'>TermQuery</a> 259</td></tr></table> 260<p>fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute</p><a name='BoostingTermQuery'></a> 261<br /><table class='elementTitle' summary="BoostingTermQuery"><tr><td class='leftElementTitle'> 262<BoostingTermQuery></td><td class='rightElementTitle'> 263Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#SpanFirst'>SpanFirst</a>, <a href='#Include'>Include</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#SpanOr'>SpanOr</a>, <a href='#SpanNear'>SpanNear</a>, <a href='#Exclude'>Exclude</a>, <a href='#Query'>Query</a> 264</td></tr></table> 265<p>A boosted term query - no analysis is done of the child text. Also a span member.</p><p>(Text below is copied from the javadocs of BoostingTermQuery)</p><p>The BoostingTermQuery is very similar to the {</p><a name='TermQuery_boost'></a> 266<br /><table class='attributeTitle' summary="boost"><tr><td class='leftAttributeTitle'> 267@boost</td><td class='rightAttributeTitle'> 268Attribute of <a href='#TermQuery'>TermQuery</a> 269</td></tr></table> 270<p>Optional boost for matches on this query. Values > 1</p><p><span class='inTextTitle'>Default value</span>: 1.0</p><a name='TermQuery_fieldName'></a> 271<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 272@fieldName</td><td class='rightAttributeTitle'> 273Attribute of <a href='#TermQuery'>TermQuery</a> 274</td></tr></table> 275<p>fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute</p><a name='TermsQuery'></a> 276<br /><table class='elementTitle' summary="TermsQuery"><tr><td class='leftElementTitle'> 277<TermsQuery></td><td class='rightElementTitle'> 278Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a> 279</td></tr></table> 280<p>The equivalent of a BooleanQuery with multiple optional TermQuery clauses. 281Child text is analyzed using a field-specific choice of Analyzer to produce a set of terms that are ORed together in Boolean logic. 282Unlike UserQuery element, this does not parse any special characters to control fuzzy/phrase/boolean logic and as such is incapable 283of producing a Query parse error given any user input</p><p><span class='inTextTitle'>Example:</span> <em>Match on text from a database description (which may contain characters that 284are illegal characters in the standard Lucene Query syntax used in the UserQuery tag</em> 285</p><pre> 286 <TermsQuery fieldName="description">Smith & Sons (Ltd) : incorporated 1982</TermsQuery> 287 </pre><p></p><blockquote><table summary='element info'><tr> 288<td class='construct'><table summary="<TermsQuery>'s attributes"><tr> 289<th class='title' colspan='3'><TermsQuery>'s attributes</th> 290</tr> 291<tr><th colspan='3' height='1' class='ruler'></th></tr> 292<tr> 293<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 294<tr><th colspan='3' height='1' class='ruler'></th></tr> 295<tr><td><a href='#TermsQuery_boost'>boost</a></td><td></td><td>1.0</td></tr><tr><td><a href='#TermsQuery_disableCoord'>disableCoord</a></td><td>true, false</td><td>false</td></tr><tr><td><a href='#TermsQuery_fieldName'>fieldName</a></td><td></td><td></td></tr><tr><td><a href='#TermsQuery_minimumNumberShouldMatch'>minimumNumberShouldMatch</a></td><td></td><td>0</td></tr></table></td></tr></table></blockquote> 296<a name='TermsQuery_boost'></a> 297<br /><table class='attributeTitle' summary="boost"><tr><td class='leftAttributeTitle'> 298@boost</td><td class='rightAttributeTitle'> 299Attribute of <a href='#TermsQuery'>TermsQuery</a> 300</td></tr></table> 301<p>Optional boost for matches on this query. Values > 1</p><p><span class='inTextTitle'>Default value</span>: 1.0</p><a name='TermsQuery_fieldName'></a> 302<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 303@fieldName</td><td class='rightAttributeTitle'> 304Attribute of <a href='#TermsQuery'>TermsQuery</a> 305</td></tr></table> 306<p>fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute</p><a name='TermsQuery_disableCoord'></a> 307<br /><table class='attributeTitle' summary="disableCoord"><tr><td class='leftAttributeTitle'> 308@disableCoord</td><td class='rightAttributeTitle'> 309Attribute of <a href='#TermsQuery'>TermsQuery</a> 310</td></tr></table> 311<p>The "Coordination factor" rewards documents that contain more of the terms in this list. This flag can be used to turn off this factor.</p><p><span class='inTextTitle'>Possible values</span>: true, false - <span class='inTextTitle'>Default value</span>: false</p><a name='TermsQuery_minimumNumberShouldMatch'></a> 312<br /><table class='attributeTitle' summary="minimumNumberShouldMatch"><tr><td class='leftAttributeTitle'> 313@minimumNumberShouldMatch</td><td class='rightAttributeTitle'> 314Attribute of <a href='#TermsQuery'>TermsQuery</a> 315</td></tr></table> 316<p>The minimum number of terms that should be present in any one document before it is considered to be a match.</p><p><span class='inTextTitle'>Default value</span>: 0</p><a name='FilteredQuery'></a> 317<br /><table class='elementTitle' summary="FilteredQuery"><tr><td class='leftElementTitle'> 318<FilteredQuery></td><td class='rightElementTitle'> 319Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a> 320</td></tr></table> 321<p>Runs a Query and filters results to only those query matches that also match the Filter element.</p><p><span class='inTextTitle'>Example:</span> <em>Find all documents about Lucene that have a status of "published"</em> 322</p><pre> 323 <FilteredQuery> 324 <Query> 325 <UserQuery>Lucene</UserQuery> 326 </Query> 327 <Filter> 328 <TermsFilter fieldName="status">published</TermsFilter> 329 </Filter> 330 </FilteredQuery> 331 </pre><p></p><blockquote><table summary='element info'><tr> 332<td class='construct'><table summary="<FilteredQuery>'s children"> 333<thead> 334<tr><th class='title' colspan='2'><FilteredQuery>'s children</th></tr> 335<tr><th colspan='2' height='1' class='ruler'></th></tr> 336<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 337<tr><th colspan='2' height='1' class='ruler'></th></tr> 338</thead> 339<tbody><tr><td><a href='#Filter'>Filter</a></td><td>Only one</td></tr> 340<tr><td><a href='#Query'>Query</a></td><td>Only one</td></tr> 341</tbody></table></td><td class='construct'><table summary="<FilteredQuery>'s attributes"><tr> 342<th class='title' colspan='3'><FilteredQuery>'s attributes</th> 343</tr> 344<tr><th colspan='3' height='1' class='ruler'></th></tr> 345<tr> 346<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 347<tr><th colspan='3' height='1' class='ruler'></th></tr> 348<tr><td><a href='#FilteredQuery_boost'>boost</a></td><td></td><td>1.0</td></tr></table></td></tr></table></blockquote> 349<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#Query'>Query</a>, <a href='#Filter'>Filter</a>)</p><a name='FilteredQuery_boost'></a> 350<br /><table class='attributeTitle' summary="boost"><tr><td class='leftAttributeTitle'> 351@boost</td><td class='rightAttributeTitle'> 352Attribute of <a href='#FilteredQuery'>FilteredQuery</a> 353</td></tr></table> 354<p>Optional boost for matches on this query. Values > 1</p><p><span class='inTextTitle'>Default value</span>: 1.0</p><a name='Query'></a> 355<br /><table class='elementTitle' summary="Query"><tr><td class='leftElementTitle'> 356<Query></td><td class='rightElementTitle'> 357Child of <a href='#FilteredQuery'>FilteredQuery</a>, <a href='#BoostingQuery'>BoostingQuery</a> 358</td></tr></table> 359<p>Used to identify a nested Query element inside another container element. NOT a top-level query tag</p><blockquote><table summary='element info'><tr> 360<td class='construct'><table summary="<Query>'s children"> 361<thead> 362<tr><th class='title' colspan='2'><Query>'s children</th></tr> 363<tr><th colspan='2' height='1' class='ruler'></th></tr> 364<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 365<tr><th colspan='2' height='1' class='ruler'></th></tr> 366</thead> 367<tbody><tr><td><a href='#BooleanQuery'>BooleanQuery</a></td><td>One or none</td></tr> 368<tr><td><a href='#BoostingQuery'>BoostingQuery</a></td><td>One or none</td></tr> 369<tr><td><a href='#BoostingTermQuery'>BoostingTermQuery</a></td><td>One or none</td></tr> 370<tr><td><a href='#ConstantScoreQuery'>ConstantScoreQuery</a></td><td>One or none</td></tr> 371<tr><td><a href='#FilteredQuery'>FilteredQuery</a></td><td>One or none</td></tr> 372<tr><td><a href='#FuzzyLikeThisQuery'>FuzzyLikeThisQuery</a></td><td>One or none</td></tr> 373<tr><td><a href='#LikeThisQuery'>LikeThisQuery</a></td><td>One or none</td></tr> 374<tr><td><a href='#MatchAllDocsQuery'>MatchAllDocsQuery</a></td><td>One or none</td></tr> 375<tr><td><a href='#NumericRangeQuery'>NumericRangeQuery</a></td><td>One or none</td></tr> 376<tr><td><a href='#SpanFirst'>SpanFirst</a></td><td>One or none</td></tr> 377<tr><td><a href='#SpanNear'>SpanNear</a></td><td>One or none</td></tr> 378<tr><td><a href='#SpanNot'>SpanNot</a></td><td>One or none</td></tr> 379<tr><td><a href='#SpanOr'>SpanOr</a></td><td>One or none</td></tr> 380<tr><td><a href='#SpanOrTerms'>SpanOrTerms</a></td><td>One or none</td></tr> 381<tr><td><a href='#SpanTerm'>SpanTerm</a></td><td>One or none</td></tr> 382<tr><td><a href='#TermQuery'>TermQuery</a></td><td>One or none</td></tr> 383<tr><td><a href='#TermsQuery'>TermsQuery</a></td><td>One or none</td></tr> 384<tr><td><a href='#UserQuery'>UserQuery</a></td><td>One or none</td></tr> 385</tbody></table></td></tr></table></blockquote> 386<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#BooleanQuery'>BooleanQuery</a> | <a href='#UserQuery'>UserQuery</a> | <a href='#FilteredQuery'>FilteredQuery</a> | <a href='#TermQuery'>TermQuery</a> | <a href='#TermsQuery'>TermsQuery</a> | <a href='#MatchAllDocsQuery'>MatchAllDocsQuery</a> | <a href='#ConstantScoreQuery'>ConstantScoreQuery</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a> | <a href='#NumericRangeQuery'>NumericRangeQuery</a> | <a href='#SpanOr'>SpanOr</a> | <a href='#SpanNear'>SpanNear</a> | <a href='#SpanOrTerms'>SpanOrTerms</a> | <a href='#SpanFirst'>SpanFirst</a> | <a href='#SpanNot'>SpanNot</a> | <a href='#SpanTerm'>SpanTerm</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a> | <a href='#LikeThisQuery'>LikeThisQuery</a> | <a href='#BoostingQuery'>BoostingQuery</a> | <a href='#FuzzyLikeThisQuery'>FuzzyLikeThisQuery</a>)</p><a name='Filter'></a> 387<br /><table class='elementTitle' summary="Filter"><tr><td class='leftElementTitle'> 388<Filter></td><td class='rightElementTitle'> 389Child of <a href='#FilteredQuery'>FilteredQuery</a> 390</td></tr></table> 391<p>The choice of Filter that MUST also be matched</p><blockquote><table summary='element info'><tr> 392<td class='construct'><table summary="<Filter>'s children"> 393<thead> 394<tr><th class='title' colspan='2'><Filter>'s children</th></tr> 395<tr><th colspan='2' height='1' class='ruler'></th></tr> 396<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 397<tr><th colspan='2' height='1' class='ruler'></th></tr> 398</thead> 399<tbody><tr><td><a href='#BooleanFilter'>BooleanFilter</a></td><td>One or none</td></tr> 400<tr><td><a href='#CachedFilter'>CachedFilter</a></td><td>One or none</td></tr> 401<tr><td><a href='#DuplicateFilter'>DuplicateFilter</a></td><td>One or none</td></tr> 402<tr><td><a href='#NumericRangeFilter'>NumericRangeFilter</a></td><td>One or none</td></tr> 403<tr><td><a href='#RangeFilter'>RangeFilter</a></td><td>One or none</td></tr> 404<tr><td><a href='#TermsFilter'>TermsFilter</a></td><td>One or none</td></tr> 405</tbody></table></td></tr></table></blockquote> 406<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#RangeFilter'>RangeFilter</a> | <a href='#NumericRangeFilter'>NumericRangeFilter</a> | <a href='#CachedFilter'>CachedFilter</a> | <a href='#TermsFilter'>TermsFilter</a> | <a href='#BooleanFilter'>BooleanFilter</a> | <a href='#DuplicateFilter'>DuplicateFilter</a>)</p><a name='RangeFilter'></a> 407<br /><table class='elementTitle' summary="RangeFilter"><tr><td class='leftElementTitle'> 408<RangeFilter/></td><td class='rightElementTitle'> 409Child of <a href='#Clause'>Clause</a>, <a href='#Filter'>Filter</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#ConstantScoreQuery'>ConstantScoreQuery</a> 410</td></tr></table> 411<p>Filter used to limit query results to documents matching a range of field values</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about banks from the last 10 years</em> 412</p><pre> 413 <FilteredQuery> 414 <Query> 415 <UserQuery>bank</UserQuery> 416 </Query> 417 <Filter> 418 <RangeFilter fieldName="date" lowerTerm="19970101" upperTerm="20070101"/> 419 </Filter> 420 </FilteredQuery> 421 </pre><p></p><blockquote> 422<table summary="<RangeFilter>'s attributes"><tr> 423<th class='title' colspan='3'><RangeFilter>'s attributes</th> 424</tr> 425<tr><th colspan='3' height='1' class='ruler'></th></tr> 426<tr> 427<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 428<tr><th colspan='3' height='1' class='ruler'></th></tr> 429<tr><td><a href='#RangeFilter_fieldName'>fieldName</a></td><td></td><td></td></tr><tr><td><a href='#RangeFilter_includeLower'>includeLower</a></td><td>true, false</td><td>true</td></tr><tr><td><a href='#RangeFilter_includeUpper'>includeUpper</a></td><td>true, false</td><td>true</td></tr><tr><td><a href='#RangeFilter_lowerTerm'>lowerTerm</a></td><td></td><td></td></tr><tr><td><a href='#RangeFilter_upperTerm'>upperTerm</a></td><td></td><td></td></tr></table></blockquote> 430<p class='emptyTagNote'>This element is always empty.</p><a name='RangeFilter_fieldName'></a> 431<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 432@fieldName</td><td class='rightAttributeTitle'> 433Attribute of <a href='#RangeFilter'>RangeFilter</a> 434</td></tr></table> 435<p>fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute</p><a name='RangeFilter_lowerTerm'></a> 436<br /><table class='attributeTitle' summary="lowerTerm"><tr><td class='leftAttributeTitle'> 437@lowerTerm</td><td class='rightAttributeTitle'> 438Attribute of <a href='#RangeFilter'>RangeFilter</a> 439</td></tr></table> 440<p>The lower-most term value for this field (must be <= upperTerm)</p><p><span class='inTextTitle'>Required</span></p><a name='RangeFilter_upperTerm'></a> 441<br /><table class='attributeTitle' summary="upperTerm"><tr><td class='leftAttributeTitle'> 442@upperTerm</td><td class='rightAttributeTitle'> 443Attribute of <a href='#RangeFilter'>RangeFilter</a> 444</td></tr></table> 445<p>The upper-most term value for this field (must be >= lowerTerm)</p><p><span class='inTextTitle'>Required</span></p><a name='RangeFilter_includeLower'></a> 446<br /><table class='attributeTitle' summary="includeLower"><tr><td class='leftAttributeTitle'> 447@includeLower</td><td class='rightAttributeTitle'> 448Attribute of <a href='#RangeFilter'>RangeFilter</a> 449</td></tr></table> 450<p>Controls if the lowerTerm in the range is part of the allowed set of values</p><p><span class='inTextTitle'>Possible values</span>: true, false - <span class='inTextTitle'>Default value</span>: true</p><a name='RangeFilter_includeUpper'></a> 451<br /><table class='attributeTitle' summary="includeUpper"><tr><td class='leftAttributeTitle'> 452@includeUpper</td><td class='rightAttributeTitle'> 453Attribute of <a href='#RangeFilter'>RangeFilter</a> 454</td></tr></table> 455<p>Controls if the upperTerm in the range is part of the allowed set of values</p><p><span class='inTextTitle'>Possible values</span>: true, false - <span class='inTextTitle'>Default value</span>: true</p><a name='NumericRangeQuery'></a> 456<br /><table class='elementTitle' summary="NumericRangeQuery"><tr><td class='leftElementTitle'> 457<NumericRangeQuery/></td><td class='rightElementTitle'> 458Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a> 459</td></tr></table> 460<p>A Query that matches numeric values within a specified range.</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about people who are aged 20-25</em> 461</p><pre> 462 <NumericRangeQuery fieldName="age" lowerTerm="20" upperTerm="25" /> 463 </pre><p></p><blockquote> 464<table summary="<NumericRangeQuery>'s attributes"><tr> 465<th class='title' colspan='3'><NumericRangeQuery>'s attributes</th> 466</tr> 467<tr><th colspan='3' height='1' class='ruler'></th></tr> 468<tr> 469<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 470<tr><th colspan='3' height='1' class='ruler'></th></tr> 471<tr><td><a href='#NumericRangeQuery_fieldName'>fieldName</a></td><td></td><td></td></tr><tr><td><a href='#NumericRangeQuery_includeLower'>includeLower</a></td><td>true, false</td><td>true</td></tr><tr><td><a href='#NumericRangeQuery_includeUpper'>includeUpper</a></td><td>true, false</td><td>true</td></tr><tr><td><a href='#NumericRangeQuery_lowerTerm'>lowerTerm</a></td><td></td><td></td></tr><tr><td><a href='#NumericRangeQuery_precisionStep'>precisionStep</a></td><td></td><td>4</td></tr><tr><td><a href='#NumericRangeQuery_type'>type</a></td><td>int, long, float, double</td><td>int</td></tr><tr><td><a href='#NumericRangeQuery_upperTerm'>upperTerm</a></td><td></td><td></td></tr></table></blockquote> 472<p class='emptyTagNote'>This element is always empty.</p><a name='NumericRangeQuery_fieldName'></a> 473<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 474@fieldName</td><td class='rightAttributeTitle'> 475Attribute of <a href='#NumericRangeQuery'>NumericRangeQuery</a> 476</td></tr></table> 477<p>fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute</p><a name='NumericRangeQuery_lowerTerm'></a> 478<br /><table class='attributeTitle' summary="lowerTerm"><tr><td class='leftAttributeTitle'> 479@lowerTerm</td><td class='rightAttributeTitle'> 480Attribute of <a href='#NumericRangeQuery'>NumericRangeQuery</a> 481</td></tr></table> 482<p>The lower-most term value for this field (must be <= upperTerm and a valid native java numeric type)</p><p><span class='inTextTitle'>Required</span></p><a name='NumericRangeQuery_upperTerm'></a> 483<br /><table class='attributeTitle' summary="upperTerm"><tr><td class='leftAttributeTitle'> 484@upperTerm</td><td class='rightAttributeTitle'> 485Attribute of <a href='#NumericRangeQuery'>NumericRangeQuery</a> 486</td></tr></table> 487<p>The upper-most term value for this field (must be >= lowerTerm and a valid native java numeric type)</p><p><span class='inTextTitle'>Required</span></p><a name='NumericRangeQuery_type'></a> 488<br /><table class='attributeTitle' summary="type"><tr><td class='leftAttributeTitle'> 489@type</td><td class='rightAttributeTitle'> 490Attribute of <a href='#NumericRangeQuery'>NumericRangeQuery</a> 491</td></tr></table> 492<p>The numeric type of this field</p><p><span class='inTextTitle'>Possible values</span>: int, long, float, double - <span class='inTextTitle'>Default value</span>: int</p><a name='NumericRangeQuery_includeLower'></a> 493<br /><table class='attributeTitle' summary="includeLower"><tr><td class='leftAttributeTitle'> 494@includeLower</td><td class='rightAttributeTitle'> 495Attribute of <a href='#NumericRangeQuery'>NumericRangeQuery</a> 496</td></tr></table> 497<p>Controls if the lowerTerm in the range is part of the allowed set of values</p><p><span class='inTextTitle'>Possible values</span>: true, false - <span class='inTextTitle'>Default value</span>: true</p><a name='NumericRangeQuery_includeUpper'></a> 498<br /><table class='attributeTitle' summary="includeUpper"><tr><td class='leftAttributeTitle'> 499@includeUpper</td><td class='rightAttributeTitle'> 500Attribute of <a href='#NumericRangeQuery'>NumericRangeQuery</a> 501</td></tr></table> 502<p>Controls if the upperTerm in the range is part of the allowed set of values</p><p><span class='inTextTitle'>Possible values</span>: true, false - <span class='inTextTitle'>Default value</span>: true</p><a name='NumericRangeQuery_precisionStep'></a> 503<br /><table class='attributeTitle' summary="precisionStep"><tr><td class='leftAttributeTitle'> 504@precisionStep</td><td class='rightAttributeTitle'> 505Attribute of <a href='#NumericRangeQuery'>NumericRangeQuery</a> 506</td></tr></table> 507<p>Lower step values mean more precisions and so more terms in index (and index gets larger). This value must be an integer</p><p><span class='inTextTitle'>Default value</span>: 4</p><a name='NumericRangeFilter'></a> 508<br /><table class='elementTitle' summary="NumericRangeFilter"><tr><td class='leftElementTitle'> 509<NumericRangeFilter/></td><td class='rightElementTitle'> 510Child of <a href='#Clause'>Clause</a>, <a href='#Filter'>Filter</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#ConstantScoreQuery'>ConstantScoreQuery</a> 511</td></tr></table> 512<p>A Filter that only accepts numeric values within a specified range</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about people who are aged 20-25</em> 513</p><pre> 514 <FilteredQuery> 515 <Query> 516 <UserQuery>person</UserQuery> 517 </Query> 518 <Filter> 519 <NumericRangeFilter fieldName="age" lowerTerm="20" upperTerm="25"/> 520 </Filter> 521 </FilteredQuery> 522 </pre><p></p><blockquote> 523<table summary="<NumericRangeFilter>'s attributes"><tr> 524<th class='title' colspan='3'><NumericRangeFilter>'s attributes</th> 525</tr> 526<tr><th colspan='3' height='1' class='ruler'></th></tr> 527<tr> 528<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 529<tr><th colspan='3' height='1' class='ruler'></th></tr> 530<tr><td><a href='#NumericRangeFilter_fieldName'>fieldName</a></td><td></td><td></td></tr><tr><td><a href='#NumericRangeFilter_includeLower'>includeLower</a></td><td>true, false</td><td>true</td></tr><tr><td><a href='#NumericRangeFilter_includeUpper'>includeUpper</a></td><td>true, false</td><td>true</td></tr><tr><td><a href='#NumericRangeFilter_lowerTerm'>lowerTerm</a></td><td></td><td></td></tr><tr><td><a href='#NumericRangeFilter_precisionStep'>precisionStep</a></td><td></td><td>4</td></tr><tr><td><a href='#NumericRangeFilter_type'>type</a></td><td>int, long, float, double</td><td>int</td></tr><tr><td><a href='#NumericRangeFilter_upperTerm'>upperTerm</a></td><td></td><td></td></tr></table></blockquote> 531<p class='emptyTagNote'>This element is always empty.</p><a name='NumericRangeFilter_fieldName'></a> 532<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 533@fieldName</td><td class='rightAttributeTitle'> 534Attribute of <a href='#NumericRangeFilter'>NumericRangeFilter</a> 535</td></tr></table> 536<p>fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute</p><a name='NumericRangeFilter_lowerTerm'></a> 537<br /><table class='attributeTitle' summary="lowerTerm"><tr><td class='leftAttributeTitle'> 538@lowerTerm</td><td class='rightAttributeTitle'> 539Attribute of <a href='#NumericRangeFilter'>NumericRangeFilter</a> 540</td></tr></table> 541<p>The lower-most term value for this field (must be <= upperTerm and a valid native java numeric type)</p><p><span class='inTextTitle'>Required</span></p><a name='NumericRangeFilter_upperTerm'></a> 542<br /><table class='attributeTitle' summary="upperTerm"><tr><td class='leftAttributeTitle'> 543@upperTerm</td><td class='rightAttributeTitle'> 544Attribute of <a href='#NumericRangeFilter'>NumericRangeFilter</a> 545</td></tr></table> 546<p>The upper-most term value for this field (must be >= lowerTerm and a valid native java numeric type)</p><p><span class='inTextTitle'>Required</span></p><a name='NumericRangeFilter_type'></a> 547<br /><table class='attributeTitle' summary="type"><tr><td class='leftAttributeTitle'> 548@type</td><td class='rightAttributeTitle'> 549Attribute of <a href='#NumericRangeFilter'>NumericRangeFilter</a> 550</td></tr></table> 551<p>The numeric type of this field</p><p><span class='inTextTitle'>Possible values</span>: int, long, float, double - <span class='inTextTitle'>Default value</span>: int</p><a name='NumericRangeFilter_includeLower'></a> 552<br /><table class='attributeTitle' summary="includeLower"><tr><td class='leftAttributeTitle'> 553@includeLower</td><td class='rightAttributeTitle'> 554Attribute of <a href='#NumericRangeFilter'>NumericRangeFilter</a> 555</td></tr></table> 556<p>Controls if the lowerTerm in the range is part of the allowed set of values</p><p><span class='inTextTitle'>Possible values</span>: true, false - <span class='inTextTitle'>Default value</span>: true</p><a name='NumericRangeFilter_includeUpper'></a> 557<br /><table class='attributeTitle' summary="includeUpper"><tr><td class='leftAttributeTitle'> 558@includeUpper</td><td class='rightAttributeTitle'> 559Attribute of <a href='#NumericRangeFilter'>NumericRangeFilter</a> 560</td></tr></table> 561<p>Controls if the upperTerm in the range is part of the allowed set of values</p><p><span class='inTextTitle'>Possible values</span>: true, false - <span class='inTextTitle'>Default value</span>: true</p><a name='NumericRangeFilter_precisionStep'></a> 562<br /><table class='attributeTitle' summary="precisionStep"><tr><td class='leftAttributeTitle'> 563@precisionStep</td><td class='rightAttributeTitle'> 564Attribute of <a href='#NumericRangeFilter'>NumericRangeFilter</a> 565</td></tr></table> 566<p>Lower step values mean more precisions and so more terms in index (and index gets larger). This value must be an integer</p><p><span class='inTextTitle'>Default value</span>: 4</p><a name='SpanTerm'></a> 567<br /><table class='elementTitle' summary="SpanTerm"><tr><td class='leftElementTitle'> 568<SpanTerm></td><td class='rightElementTitle'> 569Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#SpanFirst'>SpanFirst</a>, <a href='#Include'>Include</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#SpanOr'>SpanOr</a>, <a href='#SpanNear'>SpanNear</a>, <a href='#Exclude'>Exclude</a>, <a href='#Query'>Query</a> 570</td></tr></table> 571<p>A single term used in a SpanQuery. These clauses are the building blocks for more complex "span" queries which test word proximity</p><p><span class='inTextTitle'>Example:</span> <em>Find documents using terms close to each other about mining and accidents</em> 572</p><pre> 573 <SpanNear slop="8" inOrder="false" fieldName="text"> 574 <SpanOr> 575 <SpanTerm>killed</SpanTerm> 576 <SpanTerm>died</SpanTerm> 577 <SpanTerm>dead</SpanTerm> 578 </SpanOr> 579 <SpanOr> 580 <SpanTerm>miner</SpanTerm> 581 <SpanTerm>mining</SpanTerm> 582 <SpanTerm>miners</SpanTerm> 583 </SpanOr> 584 </SpanNear> 585 </pre><p></p><blockquote><table summary='element info'><tr> 586<td class='construct'><table summary="<SpanTerm>'s attributes"><tr> 587<th class='title' colspan='3'><SpanTerm>'s attributes</th> 588</tr> 589<tr><th colspan='3' height='1' class='ruler'></th></tr> 590<tr> 591<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 592<tr><th colspan='3' height='1' class='ruler'></th></tr> 593<tr><td><a href='#SpanTerm_fieldName'>fieldName</a></td><td></td><td></td></tr></table></td></tr></table></blockquote> 594<a name='SpanTerm_fieldName'></a> 595<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 596@fieldName</td><td class='rightAttributeTitle'> 597Attribute of <a href='#SpanTerm'>SpanTerm</a> 598</td></tr></table> 599<p>fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute</p><p><span class='inTextTitle'>Required</span></p><a name='SpanOrTerms'></a> 600<br /><table class='elementTitle' summary="SpanOrTerms"><tr><td class='leftElementTitle'> 601<SpanOrTerms></td><td class='rightElementTitle'> 602Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#SpanFirst'>SpanFirst</a>, <a href='#Include'>Include</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#SpanOr'>SpanOr</a>, <a href='#SpanNear'>SpanNear</a>, <a href='#Exclude'>Exclude</a>, <a href='#Query'>Query</a> 603</td></tr></table> 604<p>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</p><p><span class='inTextTitle'>Example:</span> <em>Use SpanOrTerms as a more convenient/succinct way of expressing multiple choices of SpanTerms. This example looks for reports 605using words describing a fatality near to references to miners</em> 606</p><pre> 607 <SpanNear slop="8" inOrder="false" fieldName="text"> 608 <SpanOrTerms>killed died death dead deaths</SpanOrTerms> 609 <SpanOrTerms>miner mining miners</SpanOrTerms> 610 </SpanNear> 611 </pre><p></p><blockquote><table summary='element info'><tr> 612<td class='construct'><table summary="<SpanOrTerms>'s attributes"><tr> 613<th class='title' colspan='3'><SpanOrTerms>'s attributes</th> 614</tr> 615<tr><th colspan='3' height='1' class='ruler'></th></tr> 616<tr> 617<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 618<tr><th colspan='3' height='1' class='ruler'></th></tr> 619<tr><td><a href='#SpanOrTerms_fieldName'>fieldName</a></td><td></td><td></td></tr></table></td></tr></table></blockquote> 620<a name='SpanOrTerms_fieldName'></a> 621<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 622@fieldName</td><td class='rightAttributeTitle'> 623Attribute of <a href='#SpanOrTerms'>SpanOrTerms</a> 624</td></tr></table> 625<p>fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute</p><p><span class='inTextTitle'>Required</span></p><a name='SpanOr'></a> 626<br /><table class='elementTitle' summary="SpanOr"><tr><td class='leftElementTitle'> 627<SpanOr></td><td class='rightElementTitle'> 628Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#SpanFirst'>SpanFirst</a>, <a href='#Include'>Include</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#SpanNear'>SpanNear</a>, <a href='#Exclude'>Exclude</a>, <a href='#Query'>Query</a> 629</td></tr></table> 630<p>Takes any number of child queries from the Span family</p><p><span class='inTextTitle'>Example:</span> <em>Find documents using terms close to each other about mining and accidents</em> 631</p><pre> 632 <SpanNear slop="8" inOrder="false" fieldName="text"> 633 <SpanOr> 634 <SpanTerm>killed</SpanTerm> 635 <SpanTerm>died</SpanTerm> 636 <SpanTerm>dead</SpanTerm> 637 </SpanOr> 638 <SpanOr> 639 <SpanTerm>miner</SpanTerm> 640 <SpanTerm>mining</SpanTerm> 641 <SpanTerm>miners</SpanTerm> 642 </SpanOr> 643 </SpanNear> 644 </pre><p></p><blockquote><table summary='element info'><tr> 645<td class='construct'><table summary="<SpanOr>'s children"> 646<thead> 647<tr><th class='title' colspan='2'><SpanOr>'s children</th></tr> 648<tr><th colspan='2' height='1' class='ruler'></th></tr> 649<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 650<tr><th colspan='2' height='1' class='ruler'></th></tr> 651</thead> 652<tbody><tr><td><a href='#BoostingTermQuery'>BoostingTermQuery</a></td><td>Any number</td></tr> 653<tr><td><a href='#SpanFirst'>SpanFirst</a></td><td>Any number</td></tr> 654<tr><td><a href='#SpanNear'>SpanNear</a></td><td>Any number</td></tr> 655<tr><td><a href='#SpanNot'>SpanNot</a></td><td>Any number</td></tr> 656<tr><td><a href='#SpanOr'>SpanOr</a></td><td>Any number</td></tr> 657<tr><td><a href='#SpanOrTerms'>SpanOrTerms</a></td><td>Any number</td></tr> 658<tr><td><a href='#SpanTerm'>SpanTerm</a></td><td>Any number</td></tr> 659</tbody></table></td></tr></table></blockquote> 660<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#SpanOr'>SpanOr</a> | <a href='#SpanNear'>SpanNear</a> | <a href='#SpanOrTerms'>SpanOrTerms</a> | <a href='#SpanFirst'>SpanFirst</a> | <a href='#SpanNot'>SpanNot</a> | <a href='#SpanTerm'>SpanTerm</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a>)*</p><a name='SpanNear'></a> 661<br /><table class='elementTitle' summary="SpanNear"><tr><td class='leftElementTitle'> 662<SpanNear></td><td class='rightElementTitle'> 663Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#SpanFirst'>SpanFirst</a>, <a href='#Include'>Include</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#SpanOr'>SpanOr</a>, <a href='#Exclude'>Exclude</a>, <a href='#Query'>Query</a> 664</td></tr></table> 665<p>Takes any number of child queries from the Span family and tests for proximity</p><blockquote><table summary='element info'><tr> 666<td class='construct'><table summary="<SpanNear>'s children"> 667<thead> 668<tr><th class='title' colspan='2'><SpanNear>'s children</th></tr> 669<tr><th colspan='2' height='1' class='ruler'></th></tr> 670<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 671<tr><th colspan='2' height='1' class='ruler'></th></tr> 672</thead> 673<tbody><tr><td><a href='#BoostingTermQuery'>BoostingTermQuery</a></td><td>Any number</td></tr> 674<tr><td><a href='#SpanFirst'>SpanFirst</a></td><td>Any number</td></tr> 675<tr><td><a href='#SpanNear'>SpanNear</a></td><td>Any number</td></tr> 676<tr><td><a href='#SpanNot'>SpanNot</a></td><td>Any number</td></tr> 677<tr><td><a href='#SpanOr'>SpanOr</a></td><td>Any number</td></tr> 678<tr><td><a href='#SpanOrTerms'>SpanOrTerms</a></td><td>Any number</td></tr> 679<tr><td><a href='#SpanTerm'>SpanTerm</a></td><td>Any number</td></tr> 680</tbody></table></td><td class='construct'><table summary="<SpanNear>'s attributes"><tr> 681<th class='title' colspan='3'><SpanNear>'s attributes</th> 682</tr> 683<tr><th colspan='3' height='1' class='ruler'></th></tr> 684<tr> 685<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 686<tr><th colspan='3' height='1' class='ruler'></th></tr> 687<tr><td><a href='#SpanNear_inOrder'>inOrder</a></td><td>true, false</td><td>true</td></tr><tr><td><a href='#SpanNear_slop'>slop</a></td><td></td><td></td></tr></table></td></tr></table></blockquote> 688<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#SpanOr'>SpanOr</a> | <a href='#SpanNear'>SpanNear</a> | <a href='#SpanOrTerms'>SpanOrTerms</a> | <a href='#SpanFirst'>SpanFirst</a> | <a href='#SpanNot'>SpanNot</a> | <a href='#SpanTerm'>SpanTerm</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a>)*</p><a name='SpanNear_slop'></a> 689<br /><table class='attributeTitle' summary="slop"><tr><td class='leftAttributeTitle'> 690@slop</td><td class='rightAttributeTitle'> 691Attribute of <a href='#SpanNear'>SpanNear</a> 692</td></tr></table> 693<p>defines the maximum distance between Span elements where distance is expressed as word number, not byte offset</p><p><span class='inTextTitle'>Example:</span> <em>Find documents using terms within 8 words of each other talking about mining and accidents</em> 694</p><pre> 695 <SpanNear slop="8" inOrder="false" fieldName="text"> 696 <SpanOr> 697 <SpanTerm>killed</SpanTerm> 698 <SpanTerm>died</SpanTerm> 699 <SpanTerm>dead</SpanTerm> 700 </SpanOr> 701 <SpanOr> 702 <SpanTerm>miner</SpanTerm> 703 <SpanTerm>mining</SpanTerm> 704 <SpanTerm>miners</SpanTerm> 705 </SpanOr> 706 </SpanNear> 707 </pre><p></p><p><span class='inTextTitle'>Required</span></p><a name='SpanNear_inOrder'></a> 708<br /><table class='attributeTitle' summary="inOrder"><tr><td class='leftAttributeTitle'> 709@inOrder</td><td class='rightAttributeTitle'> 710Attribute of <a href='#SpanNear'>SpanNear</a> 711</td></tr></table> 712<p>Controls if matching terms have to appear in the order listed or can be reversed</p><p><span class='inTextTitle'>Possible values</span>: true, false - <span class='inTextTitle'>Default value</span>: true</p><a name='SpanFirst'></a> 713<br /><table class='elementTitle' summary="SpanFirst"><tr><td class='leftElementTitle'> 714<SpanFirst></td><td class='rightElementTitle'> 715Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#Include'>Include</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#SpanOr'>SpanOr</a>, <a href='#SpanNear'>SpanNear</a>, <a href='#Exclude'>Exclude</a>, <a href='#Query'>Query</a> 716</td></tr></table> 717<p>Looks for a SpanQuery match occuring near the beginning of a document</p><p><span class='inTextTitle'>Example:</span> <em>Find letters where the first 50 words talk about a resignation:</em> 718</p><pre> 719 <SpanFirst end="50"> 720 <SpanOrTerms fieldName="text">resigning resign leave</SpanOrTerms> 721 </SpanFirst> 722 </pre><p></p><blockquote><table summary='element info'><tr> 723<td class='construct'><table summary="<SpanFirst>'s children"> 724<thead> 725<tr><th class='title' colspan='2'><SpanFirst>'s children</th></tr> 726<tr><th colspan='2' height='1' class='ruler'></th></tr> 727<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 728<tr><th colspan='2' height='1' class='ruler'></th></tr> 729</thead> 730<tbody><tr><td><a href='#BoostingTermQuery'>BoostingTermQuery</a></td><td>One or none</td></tr> 731<tr><td><a href='#SpanFirst'>SpanFirst</a></td><td>One or none</td></tr> 732<tr><td><a href='#SpanNear'>SpanNear</a></td><td>One or none</td></tr> 733<tr><td><a href='#SpanNot'>SpanNot</a></td><td>One or none</td></tr> 734<tr><td><a href='#SpanOr'>SpanOr</a></td><td>One or none</td></tr> 735<tr><td><a href='#SpanOrTerms'>SpanOrTerms</a></td><td>One or none</td></tr> 736<tr><td><a href='#SpanTerm'>SpanTerm</a></td><td>One or none</td></tr> 737</tbody></table></td><td class='construct'><table summary="<SpanFirst>'s attributes"><tr> 738<th class='title' colspan='3'><SpanFirst>'s attributes</th> 739</tr> 740<tr><th colspan='3' height='1' class='ruler'></th></tr> 741<tr> 742<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 743<tr><th colspan='3' height='1' class='ruler'></th></tr> 744<tr><td><a href='#SpanFirst_boost'>boost</a></td><td></td><td>1.0</td></tr><tr><td><a href='#SpanFirst_end'>end</a></td><td></td><td></td></tr></table></td></tr></table></blockquote> 745<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#SpanOr'>SpanOr</a> | <a href='#SpanNear'>SpanNear</a> | <a href='#SpanOrTerms'>SpanOrTerms</a> | <a href='#SpanFirst'>SpanFirst</a> | <a href='#SpanNot'>SpanNot</a> | <a href='#SpanTerm'>SpanTerm</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a>)</p><a name='SpanFirst_end'></a> 746<br /><table class='attributeTitle' summary="end"><tr><td class='leftAttributeTitle'> 747@end</td><td class='rightAttributeTitle'> 748Attribute of <a href='#SpanFirst'>SpanFirst</a> 749</td></tr></table> 750<p>Controls the end of the region considered in a document's field (expressed in word number, not byte offset)</p><p><span class='inTextTitle'>Required</span></p><a name='SpanFirst_boost'></a> 751<br /><table class='attributeTitle' summary="boost"><tr><td class='leftAttributeTitle'> 752@boost</td><td class='rightAttributeTitle'> 753Attribute of <a href='#SpanFirst'>SpanFirst</a> 754</td></tr></table> 755<p>Optional boost for matches on this query. Values > 1</p><p><span class='inTextTitle'>Default value</span>: 1.0</p><a name='SpanNot'></a> 756<br /><table class='elementTitle' summary="SpanNot"><tr><td class='leftElementTitle'> 757<SpanNot></td><td class='rightElementTitle'> 758Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#SpanFirst'>SpanFirst</a>, <a href='#Include'>Include</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#SpanOr'>SpanOr</a>, <a href='#SpanNear'>SpanNear</a>, <a href='#Exclude'>Exclude</a>, <a href='#Query'>Query</a> 759</td></tr></table> 760<p>Finds documents matching a SpanQuery but not if matching another SpanQuery</p><p><span class='inTextTitle'>Example:</span> <em>Find documents talking about social services but not containing the word "public"</em> 761</p><pre> 762 <SpanNot fieldName="text"> 763 <Include> 764 <SpanNear slop="2" inOrder="true"> 765 <SpanTerm>social</SpanTerm> 766 <SpanTerm>services</SpanTerm> 767 </SpanNear> 768 </Include> 769 <Exclude> 770 <SpanTerm>public</SpanTerm> 771 </Exclude> 772 </SpanNot> 773 </pre><p></p><blockquote><table summary='element info'><tr> 774<td class='construct'><table summary="<SpanNot>'s children"> 775<thead> 776<tr><th class='title' colspan='2'><SpanNot>'s children</th></tr> 777<tr><th colspan='2' height='1' class='ruler'></th></tr> 778<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 779<tr><th colspan='2' height='1' class='ruler'></th></tr> 780</thead> 781<tbody><tr><td><a href='#Exclude'>Exclude</a></td><td>Only one</td></tr> 782<tr><td><a href='#Include'>Include</a></td><td>Only one</td></tr> 783</tbody></table></td></tr></table></blockquote> 784<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#Include'>Include</a>, <a href='#Exclude'>Exclude</a>)</p><a name='Include'></a> 785<br /><table class='elementTitle' summary="Include"><tr><td class='leftElementTitle'> 786<Include></td><td class='rightElementTitle'> 787Child of <a href='#SpanNot'>SpanNot</a> 788</td></tr></table> 789<p>The SpanQuery to find</p><blockquote><table summary='element info'><tr> 790<td class='construct'><table summary="<Include>'s children"> 791<thead> 792<tr><th class='title' colspan='2'><Include>'s children</th></tr> 793<tr><th colspan='2' height='1' class='ruler'></th></tr> 794<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 795<tr><th colspan='2' height='1' class='ruler'></th></tr> 796</thead> 797<tbody><tr><td><a href='#BoostingTermQuery'>BoostingTermQuery</a></td><td>One or none</td></tr> 798<tr><td><a href='#SpanFirst'>SpanFirst</a></td><td>One or none</td></tr> 799<tr><td><a href='#SpanNear'>SpanNear</a></td><td>One or none</td></tr> 800<tr><td><a href='#SpanNot'>SpanNot</a></td><td>One or none</td></tr> 801<tr><td><a href='#SpanOr'>SpanOr</a></td><td>One or none</td></tr> 802<tr><td><a href='#SpanOrTerms'>SpanOrTerms</a></td><td>One or none</td></tr> 803<tr><td><a href='#SpanTerm'>SpanTerm</a></td><td>One or none</td></tr> 804</tbody></table></td></tr></table></blockquote> 805<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#SpanOr'>SpanOr</a> | <a href='#SpanNear'>SpanNear</a> | <a href='#SpanOrTerms'>SpanOrTerms</a> | <a href='#SpanFirst'>SpanFirst</a> | <a href='#SpanNot'>SpanNot</a> | <a href='#SpanTerm'>SpanTerm</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a>)</p><a name='Exclude'></a> 806<br /><table class='elementTitle' summary="Exclude"><tr><td class='leftElementTitle'> 807<Exclude></td><td class='rightElementTitle'> 808Child of <a href='#SpanNot'>SpanNot</a> 809</td></tr></table> 810<p>The SpanQuery to be avoided</p><blockquote><table summary='element info'><tr> 811<td class='construct'><table summary="<Exclude>'s children"> 812<thead> 813<tr><th class='title' colspan='2'><Exclude>'s children</th></tr> 814<tr><th colspan='2' height='1' class='ruler'></th></tr> 815<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 816<tr><th colspan='2' height='1' class='ruler'></th></tr> 817</thead> 818<tbody><tr><td><a href='#BoostingTermQuery'>BoostingTermQuery</a></td><td>One or none</td></tr> 819<tr><td><a href='#SpanFirst'>SpanFirst</a></td><td>One or none</td></tr> 820<tr><td><a href='#SpanNear'>SpanNear</a></td><td>One or none</td></tr> 821<tr><td><a href='#SpanNot'>SpanNot</a></td><td>One or none</td></tr> 822<tr><td><a href='#SpanOr'>SpanOr</a></td><td>One or none</td></tr> 823<tr><td><a href='#SpanOrTerms'>SpanOrTerms</a></td><td>One or none</td></tr> 824<tr><td><a href='#SpanTerm'>SpanTerm</a></td><td>One or none</td></tr> 825</tbody></table></td></tr></table></blockquote> 826<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#SpanOr'>SpanOr</a> | <a href='#SpanNear'>SpanNear</a> | <a href='#SpanOrTerms'>SpanOrTerms</a> | <a href='#SpanFirst'>SpanFirst</a> | <a href='#SpanNot'>SpanNot</a> | <a href='#SpanTerm'>SpanTerm</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a>)</p><a name='ConstantScoreQuery'></a> 827<br /><table class='elementTitle' summary="ConstantScoreQuery"><tr><td class='leftElementTitle'> 828<ConstantScoreQuery></td><td class='rightElementTitle'> 829Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a> 830</td></tr></table> 831<p>a utility tag to wrap any filter as a query</p><p><span class='inTextTitle'>Example:</span> <em> Find all documents from the last 10 years </em> 832</p><pre> 833 <ConstantScoreQuery> 834 <RangeFilter fieldName="date" lowerTerm="19970101" upperTerm="20070101"/> 835 </ConstantScoreQuery> 836 </pre><p></p><blockquote><table summary='element info'><tr> 837<td class='construct'><table summary="<ConstantScoreQuery>'s children"> 838<thead> 839<tr><th class='title' colspan='2'><ConstantScoreQuery>'s children</th></tr> 840<tr><th colspan='2' height='1' class='ruler'></th></tr> 841<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 842<tr><th colspan='2' height='1' class='ruler'></th></tr> 843</thead> 844<tbody><tr><td><a href='#BooleanFilter'>BooleanFilter</a></td><td>Any number</td></tr> 845<tr><td><a href='#CachedFilter'>CachedFilter</a></td><td>Any number</td></tr> 846<tr><td><a href='#DuplicateFilter'>DuplicateFilter</a></td><td>Any number</td></tr> 847<tr><td><a href='#NumericRangeFilter'>NumericRangeFilter</a></td><td>Any number</td></tr> 848<tr><td><a href='#RangeFilter'>RangeFilter</a></td><td>Any number</td></tr> 849<tr><td><a href='#TermsFilter'>TermsFilter</a></td><td>Any number</td></tr> 850</tbody></table></td><td class='construct'><table summary="<ConstantScoreQuery>'s attributes"><tr> 851<th class='title' colspan='3'><ConstantScoreQuery>'s attributes</th> 852</tr> 853<tr><th colspan='3' height='1' class='ruler'></th></tr> 854<tr> 855<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 856<tr><th colspan='3' height='1' class='ruler'></th></tr> 857<tr><td><a href='#ConstantScoreQuery_boost'>boost</a></td><td></td><td>1.0</td></tr></table></td></tr></table></blockquote> 858<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#RangeFilter'>RangeFilter</a> | <a href='#NumericRangeFilter'>NumericRangeFilter</a> | <a href='#CachedFilter'>CachedFilter</a> | <a href='#TermsFilter'>TermsFilter</a> | <a href='#BooleanFilter'>BooleanFilter</a> | <a href='#DuplicateFilter'>DuplicateFilter</a>)*</p><a name='ConstantScoreQuery_boost'></a> 859<br /><table class='attributeTitle' summary="boost"><tr><td class='leftAttributeTitle'> 860@boost</td><td class='rightAttributeTitle'> 861Attribute of <a href='#ConstantScoreQuery'>ConstantScoreQuery</a> 862</td></tr></table> 863<p>Optional boost for matches on this query. Values > 1</p><p><span class='inTextTitle'>Default value</span>: 1.0</p><a name='FuzzyLikeThisQuery'></a> 864<br /><table class='elementTitle' summary="FuzzyLikeThisQuery"><tr><td class='leftElementTitle'> 865<FuzzyLikeThisQuery></td><td class='rightElementTitle'> 866Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a> 867</td></tr></table> 868<p>Performs fuzzy matching on "significant" terms in fields. Improves on "LikeThisQuery" by allowing for fuzzy variations of supplied fields. 869Improves on FuzzyQuery by rewarding all fuzzy variants of a term with the same IDF rather than default fuzzy behaviour which ranks rarer 870variants (typically misspellings) more highly. This can be a useful default search mode for processing user input where the end user 871is not expected to know about the standard query operators for fuzzy, boolean or phrase logic found in UserQuery</p><p><span class='inTextTitle'>Example:</span> <em>Search for information about the Sumitomo bank, where the end user has mis-spelt the name</em> 872</p><pre> 873 <FuzzyLikeThisQuery> 874 <Field fieldName="contents"> 875 Sumitimo bank 876 </Field> 877 </FuzzyLikeThisQuery> 878 </pre><p></p><blockquote><table summary='element info'><tr> 879<td class='construct'><table summary="<FuzzyLikeThisQuery>'s children"> 880<thead> 881<tr><th class='title' colspan='2'><FuzzyLikeThisQuery>'s children</th></tr> 882<tr><th colspan='2' height='1' class='ruler'></th></tr> 883<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 884<tr><th colspan='2' height='1' class='ruler'></th></tr> 885</thead> 886<tbody><tr><td><a href='#Field'>Field</a></td><td>Any number</td></tr> 887</tbody></table></td><td class='construct'><table summary="<FuzzyLikeThisQuery>'s attributes"><tr> 888<th class='title' colspan='3'><FuzzyLikeThisQuery>'s attributes</th> 889</tr> 890<tr><th colspan='3' height='1' class='ruler'></th></tr> 891<tr> 892<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 893<tr><th colspan='3' height='1' class='ruler'></th></tr> 894<tr><td><a href='#FuzzyLikeThisQuery_boost'>boost</a></td><td></td><td>1.0</td></tr><tr><td><a href='#FuzzyLikeThisQuery_ignoreTF'>ignoreTF</a></td><td>true, false</td><td>false</td></tr><tr><td><a href='#FuzzyLikeThisQuery_maxNumTerms'>maxNumTerms</a></td><td></td><td>50</td></tr></table></td></tr></table></blockquote> 895<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#Field'>Field</a>)*</p><a name='FuzzyLikeThisQuery_boost'></a> 896<br /><table class='attributeTitle' summary="boost"><tr><td class='leftAttributeTitle'> 897@boost</td><td class='rightAttributeTitle'> 898Attribute of <a href='#FuzzyLikeThisQuery'>FuzzyLikeThisQuery</a> 899</td></tr></table> 900<p>Optional boost for matches on this query. Values > 1</p><p><span class='inTextTitle'>Default value</span>: 1.0</p><a name='FuzzyLikeThisQuery_maxNumTerms'></a> 901<br /><table class='attributeTitle' summary="maxNumTerms"><tr><td class='leftAttributeTitle'> 902@maxNumTerms</td><td class='rightAttributeTitle'> 903Attribute of <a href='#FuzzyLikeThisQuery'>FuzzyLikeThisQuery</a> 904</td></tr></table> 905<p>Limits the total number of terms selected from the provided text plus the selected "fuzzy" variants</p><p><span class='inTextTitle'>Default value</span>: 50</p><a name='FuzzyLikeThisQuery_ignoreTF'></a> 906<br /><table class='attributeTitle' summary="ignoreTF"><tr><td class='leftAttributeTitle'> 907@ignoreTF</td><td class='rightAttributeTitle'> 908Attribute of <a href='#FuzzyLikeThisQuery'>FuzzyLikeThisQuery</a> 909</td></tr></table> 910<p>Ignore "Term Frequency" - a boost factor which rewards multiple occurences of the same term in a document</p><p><span class='inTextTitle'>Possible values</span>: true, false - <span class='inTextTitle'>Default value</span>: false</p><a name='Field'></a> 911<br /><table class='elementTitle' summary="Field"><tr><td class='leftElementTitle'> 912<Field></td><td class='rightElementTitle'> 913Child of <a href='#FuzzyLikeThisQuery'>FuzzyLikeThisQuery</a> 914</td></tr></table> 915<p>A field used in a FuzzyLikeThisQuery</p><blockquote><table summary='element info'><tr> 916<td class='construct'><table summary="<Field>'s attributes"><tr> 917<th class='title' colspan='3'><Field>'s attributes</th> 918</tr> 919<tr><th colspan='3' height='1' class='ruler'></th></tr> 920<tr> 921<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 922<tr><th colspan='3' height='1' class='ruler'></th></tr> 923<tr><td><a href='#Field_fieldName'>fieldName</a></td><td></td><td></td></tr><tr><td><a href='#Field_minSimilarity'>minSimilarity</a></td><td></td><td>0.5</td></tr><tr><td><a href='#Field_prefixLength'>prefixLength</a></td><td></td><td>1</td></tr></table></td></tr></table></blockquote> 924<a name='Field_minSimilarity'></a> 925<br /><table class='attributeTitle' summary="minSimilarity"><tr><td class='leftAttributeTitle'> 926@minSimilarity</td><td class='rightAttributeTitle'> 927Attribute of <a href='#Field'>Field</a> 928</td></tr></table> 929<p>Controls the level of similarity required for fuzzy variants where 1 is identical and 0.5 is that the variant contains 930half of the original's characters in the same order. Lower values produce more results but may take longer to execute due to 931additional IO required to read matching document ids</p><p><span class='inTextTitle'>Default value</span>: 0.5</p><a name='Field_prefixLength'></a> 932<br /><table class='attributeTitle' summary="prefixLength"><tr><td class='leftAttributeTitle'> 933@prefixLength</td><td class='rightAttributeTitle'> 934Attribute of <a href='#Field'>Field</a> 935</td></tr></table> 936<p>Controls the minimum number of characters at the start of fuzzy variant words that must exactly match the original. 937A value of zero will require no minimum and the search software will effectively scan ALL terms from a to z looking for variations. 938This can incur high CPU overhead and a prefix length of just "1" will reduce this overhead to 1/26th of the original cost (assuming 939an even distribution of letters used from the alphabet).</p><p><span class='inTextTitle'>Default value</span>: 1</p><a name='Field_fieldName'></a> 940<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 941@fieldName</td><td class='rightAttributeTitle'> 942Attribute of <a href='#Field'>Field</a> 943</td></tr></table> 944<p>fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute</p><a name='LikeThisQuery'></a> 945<br /><table class='elementTitle' summary="LikeThisQuery"><tr><td class='leftElementTitle'> 946<LikeThisQuery></td><td class='rightElementTitle'> 947Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a> 948</td></tr></table> 949<p>Cherry-picks "significant" terms from the example child text and queries using these words. By only using significant (read: rare) terms the 950performance cost of the query is substantially reduced and large bodies of text can be used as example content.</p><p><span class='inTextTitle'>Example:</span> <em>Use a block of text as an example of the type of content to be found, ignoring the "Reuters" word which 951appears commonly in the index.</em> 952</p><pre> 953 <LikeThisQuery percentTermsToMatch="5" stopWords="Reuters"> 954 IRAQI TROOPS REPORTED PUSHING BACK IRANIANS Iraq said today its troops were pushing Iranian forces out of 955 positions they had initially occupied when they launched a new offensive near the southern port of 956 Basra early yesterday. A High Command communique said Iraqi troops had won a significant victory 957 and were continuing to advance. Iraq said it had foiled a three-pronged thrust some 10 km 958 (six miles) from Basra, but admitted the Iranians had occupied ground held by the Mohammed al-Qassem 959 unit, one of three divisions attacked. The communique said Iranian Revolutionary Guards were under 960 assault from warplanes, helicopter gunships, heavy artillery and tanks. "Our forces are continuing 961 their advance until they purge the last foothold" occupied by the Iranians, it said. 962 (Iran said its troops had killed or wounded more than 4,000 Iraqis and were stabilising their new positions.) 963 The Baghdad communique said Iraqi planes also destroyed oil installations at Iran's southwestern Ahvaz field 964 during a raid today. It denied an Iranian report that an Iraqi jet was shot down. 965 Iraq also reported a naval battle at the northern tip of the Gulf. Iraqi naval units and forces defending an 966 offshore terminal sank six Iranian out of 28 Iranian boats attempting to attack an offshore terminal, 967 the communique said. Reuters 3; 968 </LikeThisQuery> 969 </pre><p></p><blockquote><table summary='element info'><tr> 970<td class='construct'><table summary="<LikeThisQuery>'s attributes"><tr> 971<th class='title' colspan='3'><LikeThisQuery>'s attributes</th> 972</tr> 973<tr><th colspan='3' height='1' class='ruler'></th></tr> 974<tr> 975<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 976<tr><th colspan='3' height='1' class='ruler'></th></tr> 977<tr><td><a href='#LikeThisQuery_boost'>boost</a></td><td></td><td>1.0</td></tr><tr><td><a href='#LikeThisQuery_fieldNames'>fieldNames</a></td><td></td><td></td></tr><tr><td><a href='#LikeThisQuery_maxQueryTerms'>maxQueryTerms</a></td><td></td><td>20</td></tr><tr><td><a href='#LikeThisQuery_minTermFrequency'>minTermFrequency</a></td><td></td><td>1</td></tr><tr><td><a href='#LikeThisQuery_percentTermsToMatch'>percentTermsToMatch</a></td><td></td><td>30</td></tr><tr><td><a href='#LikeThisQuery_stopWords'>stopWords</a></td><td></td><td></td></tr></table></td></tr></table></blockquote> 978<a name='LikeThisQuery_boost'></a> 979<br /><table class='attributeTitle' summary="boost"><tr><td class='leftAttributeTitle'> 980@boost</td><td class='rightAttributeTitle'> 981Attribute of <a href='#LikeThisQuery'>LikeThisQuery</a> 982</td></tr></table> 983<p>Optional boost for matches on this query. Values > 1</p><p><span class='inTextTitle'>Default value</span>: 1.0</p><a name='LikeThisQuery_fieldNames'></a> 984<br /><table class='attributeTitle' summary="fieldNames"><tr><td class='leftAttributeTitle'> 985@fieldNames</td><td class='rightAttributeTitle'> 986Attribute of <a href='#LikeThisQuery'>LikeThisQuery</a> 987</td></tr></table> 988<p>Comma delimited list of field names</p><a name='LikeThisQuery_stopWords'></a> 989<br /><table class='attributeTitle' summary="stopWords"><tr><td class='leftAttributeTitle'> 990@stopWords</td><td class='rightAttributeTitle'> 991Attribute of <a href='#LikeThisQuery'>LikeThisQuery</a> 992</td></tr></table> 993<p>a list of stop words - analyzed to produce stop terms</p><a name='LikeThisQuery_maxQueryTerms'></a> 994<br /><table class='attributeTitle' summary="maxQueryTerms"><tr><td class='leftAttributeTitle'> 995@maxQueryTerms</td><td class='rightAttributeTitle'> 996Attribute of <a href='#LikeThisQuery'>LikeThisQuery</a> 997</td></tr></table> 998<p>controls the maximum number of words shortlisted for the query. The higher the number the slower the response due to more disk reads required</p><p><span class='inTextTitle'>Default value</span>: 20</p><a name='LikeThisQuery_minTermFrequency'></a> 999<br /><table class='attributeTitle' summary="minTermFrequency"><tr><td class='leftAttributeTitle'> 1000@minTermFrequency</td><td class='rightAttributeTitle'> 1001Attribute of <a href='#LikeThisQuery'>LikeThisQuery</a> 1002</td></tr></table> 1003<p>Controls how many times a term must appear in the example text before it is shortlisted for use in the query</p><p><span class='inTextTitle'>Default value</span>: 1</p><a name='LikeThisQuery_percentTermsToMatch'></a> 1004<br /><table class='attributeTitle' summary="percentTermsToMatch"><tr><td class='leftAttributeTitle'> 1005@percentTermsToMatch</td><td class='rightAttributeTitle'> 1006Attribute of <a href='#LikeThisQuery'>LikeThisQuery</a> 1007</td></tr></table> 1008<p>A quality control that can be used to limit the number of results to those documents matching a certain percentage of the shortlisted query terms. 1009Values must be between 1 and 100</p><p><span class='inTextTitle'>Default value</span>: 30</p><a name='BoostingQuery'></a> 1010<br /><table class='elementTitle' summary="BoostingQuery"><tr><td class='leftElementTitle'> 1011<BoostingQuery></td><td class='rightElementTitle'> 1012Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a> 1013</td></tr></table> 1014<p>Requires matches on the "Query" element and optionally boosts by any matches on the "BoostQuery". 1015Unlike a regular BooleanQuery the boost can be less than 1 to produce a subtractive rather than additive result 1016on the match score.</p><p><span class='inTextTitle'>Example:</span> <em>Find documents about banks, preferably related to mergers, and preferably not about "World bank"</em> 1017</p><pre> 1018 <BoostingQuery> 1019 <Query> 1020 <BooleanQuery fieldName="contents"> 1021 <Clause occurs="should"> 1022 <TermQuery>merger</TermQuery> 1023 </Clause> 1024 <Clause occurs="must"> 1025 <TermQuery>bank</TermQuery> 1026 </Clause> 1027 </BooleanQuery> 1028 </Query> 1029 <BoostQuery boost="0.01"> 1030 <UserQuery>"world bank"</UserQuery> 1031 </BoostQuery> 1032 </BoostingQuery> 1033 </pre><p></p><blockquote><table summary='element info'><tr> 1034<td class='construct'><table summary="<BoostingQuery>'s children"> 1035<thead> 1036<tr><th class='title' colspan='2'><BoostingQuery>'s children</th></tr> 1037<tr><th colspan='2' height='1' class='ruler'></th></tr> 1038<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 1039<tr><th colspan='2' height='1' class='ruler'></th></tr> 1040</thead> 1041<tbody><tr><td><a href='#BoostQuery'>BoostQuery</a></td><td>Only one</td></tr> 1042<tr><td><a href='#Query'>Query</a></td><td>Only one</td></tr> 1043</tbody></table></td><td class='construct'><table summary="<BoostingQuery>'s attributes"><tr> 1044<th class='title' colspan='3'><BoostingQuery>'s attributes</th> 1045</tr> 1046<tr><th colspan='3' height='1' class='ruler'></th></tr> 1047<tr> 1048<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 1049<tr><th colspan='3' height='1' class='ruler'></th></tr> 1050<tr><td><a href='#BoostingQuery_boost'>boost</a></td><td></td><td>1.0</td></tr></table></td></tr></table></blockquote> 1051<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#Query'>Query</a>, <a href='#BoostQuery'>BoostQuery</a>)</p><a name='BoostingQuery_boost'></a> 1052<br /><table class='attributeTitle' summary="boost"><tr><td class='leftAttributeTitle'> 1053@boost</td><td class='rightAttributeTitle'> 1054Attribute of <a href='#BoostingQuery'>BoostingQuery</a> 1055</td></tr></table> 1056<p>Optional boost for matches on this query. Values > 1</p><p><span class='inTextTitle'>Default value</span>: 1.0</p><a name='BoostQuery'></a> 1057<br /><table class='elementTitle' summary="BoostQuery"><tr><td class='leftElementTitle'> 1058<BoostQuery></td><td class='rightElementTitle'> 1059Child of <a href='#BoostingQuery'>BoostingQuery</a> 1060</td></tr></table> 1061<p>Child element of BoostingQuery used to contain the choice of Query which is used for boosting purposes</p><blockquote><table summary='element info'><tr> 1062<td class='construct'><table summary="<BoostQuery>'s children"> 1063<thead> 1064<tr><th class='title' colspan='2'><BoostQuery>'s children</th></tr> 1065<tr><th colspan='2' height='1' class='ruler'></th></tr> 1066<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 1067<tr><th colspan='2' height='1' class='ruler'></th></tr> 1068</thead> 1069<tbody><tr><td><a href='#BooleanQuery'>BooleanQuery</a></td><td>One or none</td></tr> 1070<tr><td><a href='#BoostingQuery'>BoostingQuery</a></td><td>One or none</td></tr> 1071<tr><td><a href='#BoostingTermQuery'>BoostingTermQuery</a></td><td>One or none</td></tr> 1072<tr><td><a href='#ConstantScoreQuery'>ConstantScoreQuery</a></td><td>One or none</td></tr> 1073<tr><td><a href='#FilteredQuery'>FilteredQuery</a></td><td>One or none</td></tr> 1074<tr><td><a href='#FuzzyLikeThisQuery'>FuzzyLikeThisQuery</a></td><td>One or none</td></tr> 1075<tr><td><a href='#LikeThisQuery'>LikeThisQuery</a></td><td>One or none</td></tr> 1076<tr><td><a href='#MatchAllDocsQuery'>MatchAllDocsQuery</a></td><td>One or none</td></tr> 1077<tr><td><a href='#NumericRangeQuery'>NumericRangeQuery</a></td><td>One or none</td></tr> 1078<tr><td><a href='#SpanFirst'>SpanFirst</a></td><td>One or none</td></tr> 1079<tr><td><a href='#SpanNear'>SpanNear</a></td><td>One or none</td></tr> 1080<tr><td><a href='#SpanNot'>SpanNot</a></td><td>One or none</td></tr> 1081<tr><td><a href='#SpanOr'>SpanOr</a></td><td>One or none</td></tr> 1082<tr><td><a href='#SpanOrTerms'>SpanOrTerms</a></td><td>One or none</td></tr> 1083<tr><td><a href='#SpanTerm'>SpanTerm</a></td><td>One or none</td></tr> 1084<tr><td><a href='#TermQuery'>TermQuery</a></td><td>One or none</td></tr> 1085<tr><td><a href='#TermsQuery'>TermsQuery</a></td><td>One or none</td></tr> 1086<tr><td><a href='#UserQuery'>UserQuery</a></td><td>One or none</td></tr> 1087</tbody></table></td><td class='construct'><table summary="<BoostQuery>'s attributes"><tr> 1088<th class='title' colspan='3'><BoostQuery>'s attributes</th> 1089</tr> 1090<tr><th colspan='3' height='1' class='ruler'></th></tr> 1091<tr> 1092<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 1093<tr><th colspan='3' height='1' class='ruler'></th></tr> 1094<tr><td><a href='#BoostQuery_boost'>boost</a></td><td></td><td>1.0</td></tr></table></td></tr></table></blockquote> 1095<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#BooleanQuery'>BooleanQuery</a> | <a href='#UserQuery'>UserQuery</a> | <a href='#FilteredQuery'>FilteredQuery</a> | <a href='#TermQuery'>TermQuery</a> | <a href='#TermsQuery'>TermsQuery</a> | <a href='#MatchAllDocsQuery'>MatchAllDocsQuery</a> | <a href='#ConstantScoreQuery'>ConstantScoreQuery</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a> | <a href='#NumericRangeQuery'>NumericRangeQuery</a> | <a href='#SpanOr'>SpanOr</a> | <a href='#SpanNear'>SpanNear</a> | <a href='#SpanOrTerms'>SpanOrTerms</a> | <a href='#SpanFirst'>SpanFirst</a> | <a href='#SpanNot'>SpanNot</a> | <a href='#SpanTerm'>SpanTerm</a> | <a href='#BoostingTermQuery'>BoostingTermQuery</a> | <a href='#LikeThisQuery'>LikeThisQuery</a> | <a href='#BoostingQuery'>BoostingQuery</a> | <a href='#FuzzyLikeThisQuery'>FuzzyLikeThisQuery</a>)</p><a name='BoostQuery_boost'></a> 1096<br /><table class='attributeTitle' summary="boost"><tr><td class='leftAttributeTitle'> 1097@boost</td><td class='rightAttributeTitle'> 1098Attribute of <a href='#BoostQuery'>BoostQuery</a> 1099</td></tr></table> 1100<p>Optional boost for matches on this query. A boost of >0 but <1 1101effectively demotes results from Query that match this BoostQuery.</p><p><span class='inTextTitle'>Default value</span>: 1.0</p><a name='DuplicateFilter'></a> 1102<br /><table class='elementTitle' summary="DuplicateFilter"><tr><td class='leftElementTitle'> 1103<DuplicateFilter/></td><td class='rightElementTitle'> 1104Child of <a href='#Clause'>Clause</a>, <a href='#Filter'>Filter</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#ConstantScoreQuery'>ConstantScoreQuery</a> 1105</td></tr></table> 1106<p>Removes duplicated documents from results where "duplicate" means documents share a value for a particular field such as a primary key</p><p><span class='inTextTitle'>Example:</span> <em>Find the latest version of each web page that mentions "Lucene"</em> 1107</p><pre> 1108 <FilteredQuery> 1109 <Query> 1110 <TermQuery fieldName="text">lucene</TermQuery> 1111 </Query> 1112 <Filter> 1113 <DuplicateFilter fieldName="url" keepMode="last"/> 1114 </Filter> 1115 </FilteredQuery> 1116 </pre><p></p><blockquote> 1117<table summary="<DuplicateFilter>'s attributes"><tr> 1118<th class='title' colspan='3'><DuplicateFilter>'s attributes</th> 1119</tr> 1120<tr><th colspan='3' height='1' class='ruler'></th></tr> 1121<tr> 1122<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 1123<tr><th colspan='3' height='1' class='ruler'></th></tr> 1124<tr><td><a href='#DuplicateFilter_fieldName'>fieldName</a></td><td></td><td></td></tr><tr><td><a href='#DuplicateFilter_keepMode'>keepMode</a></td><td>first, last</td><td>first</td></tr><tr><td><a href='#DuplicateFilter_processingMode'>processingMode</a></td><td>full, fast</td><td>full</td></tr></table></blockquote> 1125<p class='emptyTagNote'>This element is always empty.</p><a name='DuplicateFilter_fieldName'></a> 1126<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 1127@fieldName</td><td class='rightAttributeTitle'> 1128Attribute of <a href='#DuplicateFilter'>DuplicateFilter</a> 1129</td></tr></table> 1130<p>fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute</p><a name='DuplicateFilter_keepMode'></a> 1131<br /><table class='attributeTitle' summary="keepMode"><tr><td class='leftAttributeTitle'> 1132@keepMode</td><td class='rightAttributeTitle'> 1133Attribute of <a href='#DuplicateFilter'>DuplicateFilter</a> 1134</td></tr></table> 1135<p>Determines if the first or last document occurence is the one to return when presented with duplicated field values</p><p><span class='inTextTitle'>Possible values</span>: first, last - <span class='inTextTitle'>Default value</span>: first</p><a name='DuplicateFilter_processingMode'></a> 1136<br /><table class='attributeTitle' summary="processingMode"><tr><td class='leftAttributeTitle'> 1137@processingMode</td><td class='rightAttributeTitle'> 1138Attribute of <a href='#DuplicateFilter'>DuplicateFilter</a> 1139</td></tr></table> 1140<p>Controls the choice of process used to produce the filter - "full" mode identifies only non-duplicate documents with the chosen field 1141while "fast" mode may perform faster but will also mark documents <em>without</em> the field as valid. The former approach starts by 1142assuming every document is a duplicate then finds the "master" documents to keep while the latter approach assumes all documents are 1143unique and unmarks those documents that are a copy.</p><p><span class='inTextTitle'>Possible values</span>: full, fast - <span class='inTextTitle'>Default value</span>: full</p><a name='TermsFilter'></a> 1144<br /><table class='elementTitle' summary="TermsFilter"><tr><td class='leftElementTitle'> 1145<TermsFilter></td><td class='rightElementTitle'> 1146Child of <a href='#Clause'>Clause</a>, <a href='#Filter'>Filter</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#ConstantScoreQuery'>ConstantScoreQuery</a> 1147</td></tr></table> 1148<p>Processes child text using a field-specific choice of Analyzer to produce a set of terms that are then used as a filter.</p><p><span class='inTextTitle'>Example:</span> <em>Find documents talking about Lucene written on a Monday or a Friday</em> 1149</p><pre> 1150 <FilteredQuery> 1151 <Query> 1152 <TermQuery fieldName="text">lucene</TermQuery> 1153 </Query> 1154 <Filter> 1155 <TermsFilter fieldName="dayOfWeek">monday friday</TermsFilter> 1156 </Filter> 1157 </FilteredQuery> 1158 </pre><p></p><blockquote><table summary='element info'><tr> 1159<td class='construct'><table summary="<TermsFilter>'s attributes"><tr> 1160<th class='title' colspan='3'><TermsFilter>'s attributes</th> 1161</tr> 1162<tr><th colspan='3' height='1' class='ruler'></th></tr> 1163<tr> 1164<th class='subtitle'>Name</th><th class='subtitle'>Values</th><th class='subtitle'>Default</th></tr> 1165<tr><th colspan='3' height='1' class='ruler'></th></tr> 1166<tr><td><a href='#TermsFilter_fieldName'>fieldName</a></td><td></td><td></td></tr></table></td></tr></table></blockquote> 1167<a name='TermsFilter_fieldName'></a> 1168<br /><table class='attributeTitle' summary="fieldName"><tr><td class='leftAttributeTitle'> 1169@fieldName</td><td class='rightAttributeTitle'> 1170Attribute of <a href='#TermsFilter'>TermsFilter</a> 1171</td></tr></table> 1172<p>fieldName must be defined here or is taken from the most immediate parent XML element that defines a "fieldName" attribute</p><a name='BooleanFilter'></a> 1173<br /><table class='elementTitle' summary="BooleanFilter"><tr><td class='leftElementTitle'> 1174<BooleanFilter></td><td class='rightElementTitle'> 1175Child of <a href='#Clause'>Clause</a>, <a href='#Filter'>Filter</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#ConstantScoreQuery'>ConstantScoreQuery</a> 1176</td></tr></table> 1177<p>A Filter equivalent to BooleanQuery that applies Boolean logic to Clauses containing Filters. 1178Unlike BooleanQuery a BooleanFilter can contain a single "mustNot" clause.</p><p><span class='inTextTitle'>Example:</span> <em>Find documents from the first quarter of this year or last year that are not in "draft" status</em> 1179</p><pre> 1180 <FilteredQuery> 1181 <Query> 1182 <MatchAllDocsQuery/> 1183 </Query> 1184 <Filter> 1185 <BooleanFilter> 1186 <Clause occurs="should"> 1187 <RangeFilter fieldName="date" lowerTerm="20070101" upperTerm="20070401"/> 1188 </Clause> 1189 <Clause occurs="should"> 1190 <RangeFilter fieldName="date" lowerTerm="20060101" upperTerm="20060401"/> 1191 </Clause> 1192 <Clause occurs="mustNot"> 1193 <TermsFilter fieldName="status">draft</TermsFilter> 1194 </Clause> 1195 </BooleanFilter> 1196 </Filter> 1197 </FilteredQuery> 1198 </pre><p></p><blockquote><table summary='element info'><tr> 1199<td class='construct'><table summary="<BooleanFilter>'s children"> 1200<thead> 1201<tr><th class='title' colspan='2'><BooleanFilter>'s children</th></tr> 1202<tr><th colspan='2' height='1' class='ruler'></th></tr> 1203<tr><th class='subtitle'>Name</th><th class='subtitle'>Cardinality</th></tr> 1204<tr><th colspan='2' height='1' class='ruler'></th></tr> 1205</thead> 1206<tbody><tr><td><a href='#Clause'>Clause</a></td><td>At least one</td></tr> 1207</tbody></table></td></tr></table></blockquote> 1208<span class='inTextTitle'>Element's model:</span><p class='model'>(<a href='#Clause'>Clause</a>)+</p></body></html> 1209