[ You are here:
XTF ->
Tag Reference ->
crossQuery ->
Query Parser Output Tags -> Range Search Tag ]
Range Search Tag
This tag matches any words that fall within the range specified by the specified first and last term. It has the form:
<range {inclusive = "YesOrNo"}
{numeric = "YesOrNo"}
{field = "FieldName"}
{maxSnippets = "SnippetsToOutput"}
{boost = "BoostValue"}>
<lower>FirstTermToFind</lower>
<upper>LastTermToFind</upper>
{OptionalSectionTypeQuery}
</range>
where
inclusive="YesOrNo" |
is an optional attribute that specifies whether the range should include the first and last term when matching. If not specified, this attribute defaults to yes. |
numeric="YesOrNo" |
is an optional attribute that specifies whether the data in the field is numeric and in a rigid consistent format. If set to yes, upon the first range query on the field, XTF will read into memory a table of all the data values, converting them to 64-bit integers; subsequent queries can then be processed extremely efficiently. If this attribute is set to no, the query is much more tolerant of variable formatting in the data; XTF will expand the range query into a multi-term OR (just like a wildcard query.) However, for some types of data, wildcard expansion can result in too many terms for the engine to handle. If not specified, this attribute defaults to no. |
field="FieldName" |
is an optional attribute that identifies which field in the index to search. Often this attribute is set to text to indicate that the main text of the document should be searched. It can also be set to the name of a meta field such as author or subject. It should be mentioned that if the field attribute appears in any tags outside it, the field name in the <range> tag must match the value set in the outer tags. Otherwise, an error will be generated. (Note: Allowing nested copies of the maxSnippets attribute doesn't serve a purpose other than to make it easier to write docReqParser.xsl stylesheets in a uniform way. Effectively, the outermost maxSnippets value is always used.) |
maxSnippets="SnippetsToOutput" |
is an optional attribute that identifies the number of snippets to pass on to the Result Formatter stylesheet for display. A snippet is defined as the matching text found in a document for a particular query, along with some additional text around it for context. The amount of context displayed for each match is defined by the maxContext attribute. If not specified this attribute defaults to 3, meaning snippets for the top three matches for a document are returned. Also, this attribute can be set to -1, meaning all the snippets for a document are returned. As with the field attribute, if the maxSnippets attribute appears in any containing tags, the value set for it in the <range> tag must match the value set in the containing tags. Otherwise, an error will be generated. (Note: Allowing nested copies of the maxSnippets attribute doesn't serve a purpose other than to make it easier to write docReqParser.xsl stylesheets in a uniform way. Effectively, the outermost maxSnippets value is always used.) |
boost="BoostValue" |
is an optional attribute that specifies a relevance boost multiplier for this clause in the query. Boost values higher than 1.0 increase the relevance of a clause, while boost values between 0.0 and 1.0 decrease the relevance of a clause. Boost values less than zero will generate an error. |
FirstTermToFind |
is the first term in the range to find. Usually, this is a starting number, date, or year. |
LastTermToFind |
is the last term in the range to find. Usually, this is an ending number, date, or year. |
This tag returns a match for any word that lexicographically falls in the range specified by the upper and lower tags. This tag is primarily used to search for a range of revision numbers, dates, or years.
If the field is "text", a
Section Type sub-query may optionally appear, restricting this query to particular sections of a document based on section types added by the
Pre-Filter stylesheet at index time.