Database Reference
In-Depth Information
• For a fuzzy search (words like the search term), add a tilde character at the end,
as in
database~
.
• Add a
+
in front of words and phrases that must occur.
+exist database
means
the text
must
include the word
exist
but
may
include the word
database
.
• Add a
-
in front of words and phrases that should
not
occur in the text.
• Boolean operators (
AND
,
OR
, and
NOT
) are supported.
• You can group expressions using parentheses.
The full-text query XML specification
The
ft:query
function also accepts an XML fragment that allows you to build a
query using Lucene's internal API indirectly. The XML is transformed into an inter‐
nal representation used by Lucene and then executed. This fragment takes the follow‐
ing form:
<query>
( term | wildcard | regex | phrase | near | bool )+
</query>
All subelements accept an optional
boost
attribute of type
xs:float
to specify a
boost value for the score (see
“Scoring Searches” on page 296
). The
query
element can
contain the following subelements:
• The
term
element defines a single term to search for. The following example
searches for text containing
exist
and/or
database
:
<query>
<term>
exist
</term>
<term>
database
</term>
</query>
• The
wildcard
element is the same as the
term
element but can contain a wild‐
card
*
or
?
operator. To search for all text with words starting with
data
, use:
<query>
<wildcard>
data*
</wildcard>
</query>
• The
regex
element contains a regular expression used for the search.
• The
phrase
element searches for a group of terms
in the correct order
. It can con‐
tain text (which is tokenized into terms), or a number of
term
child elements.
The following two examples are equivalent:
<query>
<phrase>
exist database
</phrase>
</query>
Search WWH ::
Custom Search