atg.search.routing.command.search
Class SearchResultsResponse

java.lang.Object
  extended by atg.search.routing.command.SearchXMLObject
      extended by atg.search.routing.command.SearchEngineCommandResponse
          extended by atg.search.routing.command.search.SearchResponse
              extended by atg.search.routing.command.search.SearchResultsResponse
All Implemented Interfaces:
PagedResponse, java.io.Serializable
Direct Known Subclasses:
QueryRequest.Response, SimilarDocsRequest.Response, StructuredQueryRequest.Response

public abstract class SearchResultsResponse
extends SearchResponse
implements PagedResponse

A SearchEngineCommandResponse that also provides search result specific information. The response for search-type commands (i.e. QueryRequest, SimilarDocsRequest or StructureQueryRequest) should sub-type this class so that callers can polymorphically process the search response results.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.search.routing.command.search.SearchResponse
mMultiPartitionSearch
 
Constructor Summary
protected SearchResultsResponse()
           
protected SearchResultsResponse(atg.search.routing.command.SearchEngineResponse response)
           
 
Method Summary
 void addResult(Result pResult)
          Adds a result to the existing list.
 void addResults(java.util.Collection<Result> pResults)
          Adds every element in the list to the existing list of results.
 boolean equals(java.lang.Object pObject)
           
abstract  int getGroupCount()
          Returns the total number of answer groups in the results, regardless of paging.
 java.util.List<AnswerGroup> getGroups()
          Returns the list of answer groups.
 boolean getHasMoreResults()
          Returns true if there are more results for fast paging.
 int getMinScore()
          Returns the minimum score
 int getPageNum()
          Returns the zero-based page number of this response
 atg.search.routing.command.search.PageOffsetInfo getPageOffsetInfo()
          If the response is the result of a merge, this holds the last response index per partition
 int getPageSize()
          Returns the page size
 java.util.List<Result> getResults()
          These are the results.
 java.util.List<java.util.List<Result>> getResultsWithGrouping()
          These are the same results available via getResults(), but they are returned grouped into one List per answer group (as defined by Result.getAnswerGroup().
 java.util.List<SpellingTerm> getSpellingTerms()
          Returns a list of spelling terms
 java.util.List<SuggestedCategory> getSuggestedCategories()
          Returns the List of SuggestedCategory objects
 void setMinScore(int pMinScore)
          Sets the minimum score
 void setPageNum(int pPageNum)
          Sets the zero-based page number of this response
 void setPageOffsetInfo(atg.search.routing.command.search.PageOffsetInfo pageOffsetInfo)
          Sets the page offset info
 void setPageSize(int pPageSize)
          Sets the page size
 void setResults(java.util.List<Result> pResults)
          Sets the list of Results.
 void setSpellingTerms(java.util.List<SpellingTerm> spellingTerms)
          Sets the list of spelling terms
 void setSuggestedCategories(java.util.List<SuggestedCategory> suggestedCategories)
          Sets the list of suggested categories
 
Methods inherited from class atg.search.routing.command.search.SearchResponse
addError, getContentId, getErrors, getMergeTimeMs, getParseTimeMs, getPartitionResponses, getRequestChainToken, getRequestIdentifier, getRequestTime, getSearchTargetNames, getTotalResponseTimeMs, handleMerge, isAllowListProperties, isLocalMergeEnabled, isMultiPartitionSearch, isTimedOut, merge, setAllowListProperties, setErrors, setLocalMergeEnabled, setMergeTimeMs, setMultiPartitionSearch, setParseTimeMs, setPartitionResponses, setRequestChainToken, setRequestIdentifier, setRequestTime, setSearchTargetNames, setTotalResponseTimeMs, toString
 
Methods inherited from class atg.search.routing.command.SearchEngineCommandResponse
getNextResponse, getNonSAXParser, getRequestTag, getSearchEngineResponse, parseResponse, setNextResponse, setSearchEngineResponse
 
Methods inherited from class atg.search.routing.command.SearchXMLObject
appendComplexXml, appendOptionalAttr, appendOptionalElem, appendOptionalElem, appendOptionalElem, appendRequiredAttr, appendRequiredElem, appendRequiredElem, appendRequiredValue, getAllAttributeXML, getAllBodyXML, getAttributeXML, getBodyXML, getDefaultXmlBytes, getParentXMLObject, getXmlPath, setParentXMLObject, toXML, toXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

SearchResultsResponse

protected SearchResultsResponse()

SearchResultsResponse

protected SearchResultsResponse(atg.search.routing.command.SearchEngineResponse response)
Method Detail

equals

public boolean equals(java.lang.Object pObject)
Overrides:
equals in class java.lang.Object

getGroupCount

public abstract int getGroupCount()
Returns the total number of answer groups in the results, regardless of paging. For requests that don't result in answer groups, such as SimilarDocsRequest, this is simply the number of results.

Specified by:
getGroupCount in interface PagedResponse
Returns:
total number of answer groups in the results, ignoring paging

getResults

public java.util.List<Result> getResults()
These are the results. List of Results. See getResultsWithGrouping() if you want the individual Results grouped by answer groups.

Returns:
List of Results.

getGroups

public java.util.List<AnswerGroup> getGroups()
Returns the list of answer groups. To retrieve the flat list of results call getResults(). This is not a 'live' list of groups (or results). That is, changes to this list will not be reflected in the flat list of results. However, changes to the flat list will be reflected in the list. And changes to individual Results will be reflected in the flat list.

Returns:
list of AnswerGroups

getResultsWithGrouping

public java.util.List<java.util.List<Result>> getResultsWithGrouping()
These are the same results available via getResults(), but they are returned grouped into one List per answer group (as defined by Result.getAnswerGroup(). Thus the return value is a List of Lists, where each sub-List corresponds to a specific answer group.

Returns:
List of Lists of Results.

getHasMoreResults

public boolean getHasMoreResults()
Returns true if there are more results for fast paging. Returns false if all results have already been retrieved. If this is called for a non-fast paged request, or a single-partition index request, it will return false.

Specified by:
getHasMoreResults in interface PagedResponse
Returns:
true if there are more results for fast paging. Returns false if all results have already been retrieved or if this is not a fast paged request

setResults

public void setResults(java.util.List<Result> pResults)
Sets the list of Results.

Parameters:
pResults - the results

addResult

public void addResult(Result pResult)
Adds a result to the existing list.

Parameters:
pResult - a result

addResults

public void addResults(java.util.Collection<Result> pResults)
Adds every element in the list to the existing list of results.

Parameters:
pResults - list of results

getMinScore

public int getMinScore()
Returns the minimum score

Returns:
the minimum score

setMinScore

public void setMinScore(int pMinScore)
Sets the minimum score

Parameters:
pMinScore - the minimum score

getPageNum

public int getPageNum()
Description copied from interface: PagedResponse
Returns the zero-based page number of this response

Specified by:
getPageNum in interface PagedResponse
Returns:
zero-based page number of this response

setPageNum

public void setPageNum(int pPageNum)
Description copied from interface: PagedResponse
Sets the zero-based page number of this response

Specified by:
setPageNum in interface PagedResponse

getPageSize

public int getPageSize()
Description copied from interface: PagedResponse
Returns the page size

Specified by:
getPageSize in interface PagedResponse
Returns:
results per page

setPageSize

public void setPageSize(int pPageSize)
Description copied from interface: PagedResponse
Sets the page size

Specified by:
setPageSize in interface PagedResponse

getPageOffsetInfo

public atg.search.routing.command.search.PageOffsetInfo getPageOffsetInfo()
Description copied from interface: PagedResponse
If the response is the result of a merge, this holds the last response index per partition

Specified by:
getPageOffsetInfo in interface PagedResponse
Returns:
If the response is the result of a merge, this holds the last response index per partition

setPageOffsetInfo

public void setPageOffsetInfo(atg.search.routing.command.search.PageOffsetInfo pageOffsetInfo)
Description copied from interface: PagedResponse
Sets the page offset info

Specified by:
setPageOffsetInfo in interface PagedResponse
Parameters:
pageOffsetInfo - page offset information

getSpellingTerms

public java.util.List<SpellingTerm> getSpellingTerms()
Returns a list of spelling terms

Returns:
List of SpellingTerm

setSpellingTerms

public void setSpellingTerms(java.util.List<SpellingTerm> spellingTerms)
Sets the list of spelling terms

Parameters:
spellingTerms - list of spelling terms

getSuggestedCategories

public java.util.List<SuggestedCategory> getSuggestedCategories()
Returns the List of SuggestedCategory objects

Returns:
List of SuggestedCategory objects

setSuggestedCategories

public void setSuggestedCategories(java.util.List<SuggestedCategory> suggestedCategories)
Sets the list of suggested categories

Parameters:
suggestedCategories - the list of suggested categories