com.plumtree.server.search
Interface IPTSQueryResponse


public interface IPTSQueryResponse

The response from a search query request.


Method Summary
 void clear()
          Clears this object and releases references to any result set.
 IPTSGroupInfo getAllOthersGroup()
          Returns information about items that could not be categorized into any of the groups returned by getGroups.
 IPTSQuery getCompleteQuery()
           
 int getFirstResultIndex()
          Returns the index of the first result that is part of this response (1-based).
 IPTSGroupInfo[] getGroups()
          Returns groups discovered during execution of this query, if IPTSQueryRequest.setResultsGroupBy was called.
 com.plumtree.openfoundation.util.IXPEnumerator getResults()
          Returns an enumeration of the actual results that matched the query.
 int getReturnedCount()
          Returns the number of results returned as part of this response.
 IPTSSpellingCorrection[] getSpellingCorrections()
          Returns spelling corrections applied as part of the request.
 int getTotalCount()
          Returns the total number of items in the search server that matched the query; not all were necessarily returned.
 boolean queryIsPartial()
          Returns true if the query was executed on a partial search cluster(some nodes were down).
 boolean queryTimedOut()
          Returns true if the request took too much time to run and a partial result set was returned.
 boolean wildcardExpansionIncomplete()
          Returns true if processing of a wildcarded query term (e.g.
 

Method Detail

getFirstResultIndex

int getFirstResultIndex()
Returns the index of the first result that is part of this response (1-based). (If the results page says "Results 11-20 of 43", this method returns 11.)

Returns:
index of the first result returned

getReturnedCount

int getReturnedCount()
Returns the number of results returned as part of this response. (If the results page says "Results 11-20 of 43", this method returns 10.)

Returns:
number of results returned as part of this response

getTotalCount

int getTotalCount()
Returns the total number of items in the search server that matched the query; not all were necessarily returned. (If the results page says "Results 11-20 of 43", this method returns 43.)

Returns:
total number of items in the search server that matched the query; not all were necessarily returned

getCompleteQuery

IPTSQuery getCompleteQuery()
Returns:
the complete query that was executed, including any restrictions (includes any queries provided to IPTSQueryRequest.setQuery, IPTSQueryRequest.restrictTo, and IPTSQueryRequest.restrictToAnyOf). IPTSQueryRequest simply ANDs all of these queries and restrictions together using an internally-constructed IPTSBooleanQuery; that internally constructed query is what this method returns.

queryTimedOut

boolean queryTimedOut()
Returns true if the request took too much time to run and a partial result set was returned. Note that no exception is thrown in this case; the Search Server simply returns an incomplete result set, and you may wish to display a message to the user indicating this.

Also, note that this method is not meant to be called during execution of the request (after all, this IPTSQueryResponse object has not yet been constructed); you should call it after IPTSQueryRequest.execute returns, to determine whether execution completed or not.

Returns:
true if the query took too much time to run and a partial result set was returned.

queryIsPartial

boolean queryIsPartial()
Returns true if the query was executed on a partial search cluster(some nodes were down).

Returns:
true if search cluster query state was not "complete" or "impared".

wildcardExpansionIncomplete

boolean wildcardExpansionIncomplete()
Returns true if processing of a wildcarded query term (e.g. "p*") took too long or yielded too many possibilities to consider; ; in this case a subset of the possible wildcard matches were actually used for the query, and an incomplete result set is returned. You may wish to display a message to the end-user indicating that this happened.

Returns:
true if processing of a wildcarded query term (e.g. "p*") took too long or yielded too many possibilities to consider; in this case a subset of the possible wildcard matches were actually used for the query.

getResults

com.plumtree.openfoundation.util.IXPEnumerator getResults()
Returns an enumeration of the actual results that matched the query. Elements are of type IPTSResult; the number of items in this enumeration is equal to the value returned by getReturnedCount.

Returns:
An enumeration of the actual results that matched the query.

getSpellingCorrections

IPTSSpellingCorrection[] getSpellingCorrections()
Returns spelling corrections applied as part of the request. May be null or an empty array if there are no corrections.

Returns:
Spelling corrections applied as part of the request.

getGroups

IPTSGroupInfo[] getGroups()
Returns groups discovered during execution of this query, if IPTSQueryRequest.setResultsGroupBy was called. This array does not include the set of results that could not be categorized into any group; call getAllOthersGroup for that set.

Returns:
Groups discovered during execution of this query.

getAllOthersGroup

IPTSGroupInfo getAllOthersGroup()
Returns information about items that could not be categorized into any of the groups returned by getGroups.

Returns:
Information about items that could not be categorized into any of the groups returned by getGroups.

clear

void clear()
Clears this object and releases references to any result set. Calling this method as soon as you are done with the object may promote more efficient garbage collection. After this method is called, no more methods should be called on the object.