With the methods and properties that belong
to the Query interface,
you can control many aspects of query behavior, including how the
query is processed, how results are returned, and what metadata is
returned with each result.
See the Javadoc documentation for more details about
each
method and property.
Enabling fuzzy searches in n-gram collections
A fuzzy search query searches for character sequences that
are not only the same but similar to the query term. All possible
n-grams are treated as search terms, and the query returns documents
including specified n-grams. However, it does not always mean that
the documents have character sequences that are similar to the query
term.
Specifying query languages
You can use the setQueryLanguage(java.lang.String
lang) method to specify a language other than the collection
default language on the search server.
Setting linguistic modes
Use the setLinguisticMode(int mode) method
to specify how you want the search engine to match query terms.
Returning metadata fields
You can use the setReturnedFields(String[]
fieldNames) method
to control which metadata fields are returned in the Result object.
Enabling predefined result attribute values
You can
use the setReturnedAttribute(int attributeType,
boolean isReturned) method to enable or disable any of the
predefined result attribute values that are returned with each Result object.
Specifying the range of results
You can use the setRequestedResultRange(int
fromResult,
int numberOfResult) method to specify the range of returned
results.
Setting category details
You can specify the required category detail
level for
query results by using the setResultCategoriesDetailLevel(int
detailLevel) method.
Enabling site collapse
You can use the setSiteCollapsingEnabled(boolean
value) method to specify whether the top results contain
more than two results from the same website or data source.
Setting predefined links
You can set predefined links by using the setPredefinedResultsEnabled
(boolean value) method.