com.plumtree.server.search
Interface IPTSModifiableQuery

All Superinterfaces:
IPTSQuery
All Known Subinterfaces:
IPTSBooleanQuery

public interface IPTSModifiableQuery
extends IPTSQuery

Base interface for all search queries that can be modified with extra options such as spell correction, thesaurus, etc. Full-text and metadata queries typically could be modified, but collection or security queries usually are not. Queries that have child queries (e.g. IPTSBooleanQuery) are usually modifiable as well, and the selected modification options apply to any child queries that are also modifiable.


Method Summary
 void useBestBets(java.lang.String trigger)
          Return best bet targets for the provided trigger string as the first results for this query.
 void useSpellCorrection()
          Spell-correct this query.
 void useThesaurus()
          Expand tokens in this query using the thesaurus.
 

Method Detail

useSpellCorrection

void useSpellCorrection()
Spell-correct this query. In the case of compound queries, such as IPTSBooleanQuery, all child queries are spell-corrected as well.

Note that there is no way to turn off spell-correction on a single child IPTSQuery. Be sure that none of this query's subqueries contain constraints that should not be spell-corrected, such as ID or security constraints.


useThesaurus

void useThesaurus()
Expand tokens in this query using the thesaurus. In the case of compound queries, such as IPTSBooleanQuery, the thesaurus is applied to all child queries as well.

Note that there is no way to turn off thesaurus usage on a single child IPTSQuery. Be sure that none of this query's subqueries contain constraints that should not use the thesaurus, such as ID or security constraints.


useBestBets

void useBestBets(java.lang.String trigger)
Return best bet targets for the provided trigger string as the first results for this query.

Note that the best bet target results do not need to match the query to be returned. This means you must be careful to call useBestBets on the correct IPTSQuery in a query tree. For example, suppose your complete tree is ((TextQuery for dog) AND (in folder 27)). In this case, "TextQuery for dog", "folder 27", and the top-level BooleanQuery (AND) are all separate IPTSQuery objects. If you call useBestBets on the TextQuery, the folder restriction will be applied to the best bet targets as well as the other results, so you will only get targets in folder 27. If you call useBestBets on the top-level BooleanQuery instead, you will see best bet targets regardless of the folder they are located in.

Parameters:
trigger - the best bet trigger string for this query, or null to turn off use of best bets for this query.