atg.search.routing.command.search
Class TreeQueryRequest.Response

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.TreeQueryRequest.Response
All Implemented Interfaces:
PagedResponse, java.io.Serializable
Enclosing class:
TreeQueryRequest

public static class TreeQueryRequest.Response
extends SearchResponse
implements PagedResponse

TreeQueryRequest Response type

See Also:
Serialized Form

Nested Class Summary
 class TreeQueryRequest.Response.ItemAnswerGroup
          An "answer group" for items, even though there is only ever one per group.
 
Field Summary
 
Fields inherited from class atg.search.routing.command.search.SearchResponse
CLASS_VERSION, mMultiPartitionSearch
 
Fields inherited from interface atg.search.routing.command.search.PagedResponse
CLASS_VERSION
 
Constructor Summary
TreeQueryRequest.Response()
           
TreeQueryRequest.Response(atg.search.routing.command.SearchEngineResponse response)
           
TreeQueryRequest.Response(TreeQueryRequest pRequest, java.util.List<SearchResponse> pParsedResponses)
          This uses Java Merge instead of the engine's merge.
 
Method Summary
 boolean equals(java.lang.Object pObject)
           
protected  void getAttributeXML(java.lang.StringBuilder buf)
          Override to provide attributes.
protected  void getBodyXML(java.lang.StringBuilder buf)
          Override to provide the body of the xml.
 java.lang.String getContentId()
          content ID for index partition
 java.lang.String getDebug()
          Returns debug information from the engine
 int getDocCandidates()
          Number of document candidates considered during retrieval
 int getDocMax()
          An estimate of how many documents are retrievable by the current query
 int getDocMin()
          Minimum number of documents that could be considered, if all query terms were in the same documents
 atg.search.routing.command.search.DocSortCommon getDocSort()
          Returns the docSort
 TreeQueryRequest.DocSortOrder getDocSortOrder()
          Returns the doc sort order
 java.lang.String getDocSortProp()
          Returns the doc sort property
 java.lang.String getDocSortPropDefault()
          Returns the doc sort property default
 java.util.List<FieldResponse> getFields()
          Returns input fields with additional information
 int getGroupCount()
          total number of answer groups before paging.
 boolean getHasMoreResults()
          Returns true if there are more results.
 java.util.List<Item> getItems()
          The Items.
 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.Collection getProcessedPartitionResponses()
          Gets the processed the engine responses from individual partitions.
 java.lang.String getRequestTag()
          Gets the xml element tag used in the request
protected  void merge(SearchRequest pRequest, java.util.List<SearchResponse> pParsedResponses)
          This is the Java merge.
 void setContentId(java.lang.String contentId)
          Sets content ID for index partition
 void setDebug(java.lang.String pDebug)
          Sets debug information from the engine
 void setDocCandidates(int docCandidates)
          Sets the number of document candidates considered during retrieval
 void setDocMax(int docMax)
          Sets an estimate of how many documents are retrievable by the current query
 void setDocMin(int docMin)
          Sets the minimum number of documents that could be considered, if all query terms were in the same documents
 void setDocSort(atg.search.routing.command.search.DocSortCommon docSort)
          Sets the docsort
 void setDocSortOrder(TreeQueryRequest.DocSortOrder docSortOrder)
          Sets the doc sort order
 void setDocSortProp(java.lang.String docSortProp)
          Sets the doc sort property
 void setDocSortPropDefault(java.lang.String docSortPropDefault)
          Sets the doc sort property default
 void setFields(java.util.List<FieldResponse> pFields)
          Sets input fields with additional information
 void setGroupCount(int groupCount)
          Sets the total group count before paging.
 void setItems(java.util.List<Item> pItems)
          Sets the items.
 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
 
Methods inherited from class atg.search.routing.command.search.SearchResponse
addError, getBuildTimeMs, getErrors, getListableProperties, getMergeTimeMs, getParseTimeMs, getPartitionResponses, getRequestChainToken, getRequestIdentifier, getRequestTime, getSearchTargetNames, getTotalResponseTimeMs, handleMerge, isAllowListProperties, isLocalMergeEnabled, isMultiPartitionSearch, isOverloaded, isTimedOut, setAllowListProperties, setBuildTimeMs, setErrors, setListableProperties, setLocalMergeEnabled, setMergeTimeMs, setMultiPartitionSearch, setParseTimeMs, setPartitionResponses, setRequestChainToken, setRequestIdentifier, setRequestTime, setSearchTargetNames, setTotalResponseTimeMs, toString
 
Methods inherited from class atg.search.routing.command.SearchEngineCommandResponse
getNextResponse, getNonSAXParser, getSearchEngineResponse, parseResponse, setNextResponse, setSearchEngineResponse
 
Methods inherited from class atg.search.routing.command.SearchXMLObject
appendComplexXml, appendOptionalAttr, appendOptionalElem, appendOptionalElem, appendOptionalElem, appendOptionalValue, appendRequiredAttr, appendRequiredElem, appendRequiredElem, appendRequiredValue, getAllAttributeXML, getAllBodyXML, getDefaultXmlBytes, getParentXMLObject, getXmlPath, isPrintedFirstChild, setParentXMLObject, setPrintedFirstChild, toXML, toXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeQueryRequest.Response

public TreeQueryRequest.Response()

TreeQueryRequest.Response

public TreeQueryRequest.Response(atg.search.routing.command.SearchEngineResponse response)

TreeQueryRequest.Response

public TreeQueryRequest.Response(TreeQueryRequest pRequest,
                                 java.util.List<SearchResponse> pParsedResponses)
                          throws atg.search.routing.MergeException
This uses Java Merge instead of the engine's merge. Invocation of this constructor results in a single merged Response. See merge(SearchRequest, java.util.List).

Parameters:
pRequest - original request
pParsedResponses - parsed responses
Throws:
atg.search.routing.MergeException
Method Detail

equals

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

merge

protected void merge(SearchRequest pRequest,
                     java.util.List<SearchResponse> pParsedResponses)
              throws atg.search.routing.MergeException
This is the Java merge. TreeQuery doesn't support sorting by default, so merging must take a selection from each partition. Or else only take from the smallest partitions. That is, take from the largest physical partition index first

Specified by:
merge in class SearchResponse
Parameters:
pRequest -
pParsedResponses -
Throws:
atg.search.routing.MergeException - if the merge fails

getRequestTag

public java.lang.String getRequestTag()
Gets the xml element tag used in the request

Overrides:
getRequestTag in class atg.search.routing.command.SearchEngineCommandResponse
Returns:
xml element tag

getAttributeXML

protected void getAttributeXML(java.lang.StringBuilder buf)
                        throws atg.search.routing.command.IncompleteCommandException
Override to provide attributes.

Overrides:
getAttributeXML in class atg.search.routing.command.SearchXMLObject
Throws:
atg.search.routing.command.IncompleteCommandException - if required values are missing

getBodyXML

protected void getBodyXML(java.lang.StringBuilder buf)
                   throws atg.search.routing.command.IncompleteCommandException
Override to provide the body of the xml. Do not include the main element tag.

Overrides:
getBodyXML in class atg.search.routing.command.SearchXMLObject
Throws:
atg.search.routing.command.IncompleteCommandException

getProcessedPartitionResponses

public java.util.Collection getProcessedPartitionResponses()
Gets the processed the engine responses from individual partitions. This is only for multi-partition results. This is a costly operation, and is made available primarily for debugging purposes. The original engine responses are normally not available due to the storage overhead. To enable their storage, call SearchEngineRequestImpl.setKeepingResponseData(boolean).

Returns:
Collection of TreeQueryRequest.Response, possibly empty but never null. Bad results will have null elements in the collection.

getDebug

public java.lang.String getDebug()
Returns debug information from the engine

Returns:
debug information from the engine

setDebug

public void setDebug(java.lang.String pDebug)
Sets debug information from the engine

Parameters:
pDebug - debug information from the engine

getDocCandidates

public int getDocCandidates()
Number of document candidates considered during retrieval

Returns:
Number of document candidates considered during retrieval

setDocCandidates

public void setDocCandidates(int docCandidates)
Sets the number of document candidates considered during retrieval

Parameters:
docCandidates - number of document candidates considered during retrieval

getDocMax

public int getDocMax()
An estimate of how many documents are retrievable by the current query

Returns:
An estimate of how many documents are retrievable by the current query

setDocMax

public void setDocMax(int docMax)
Sets an estimate of how many documents are retrievable by the current query

Parameters:
docMax - an estimate of how many documents are retrievable by the current query

getDocMin

public int getDocMin()
Minimum number of documents that could be considered, if all query terms were in the same documents

Returns:
Minimum number of documents that could be considered, if all query terms were in the same documents

setDocMin

public void setDocMin(int docMin)
Sets the minimum number of documents that could be considered, if all query terms were in the same documents

Parameters:
docMin - the minimum number of documents that could be considered, if all query terms were in the same documents

getContentId

public java.lang.String getContentId()
content ID for index partition

Overrides:
getContentId in class SearchResponse
Returns:
content ID for index partition

setContentId

public void setContentId(java.lang.String contentId)
Sets content ID for index partition

Parameters:
contentId - content ID for index partition

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

getGroupCount

public int getGroupCount()
Description copied from interface: PagedResponse
total number of answer groups before paging. For response types that do not use answer groups, this is the total number of results.

Specified by:
getGroupCount in interface PagedResponse
Returns:
total number of answer groups before paging

getHasMoreResults

public boolean getHasMoreResults()
Description copied from interface: PagedResponse
Returns true if there are more results. Returns false if all results have already been retrieved

Specified by:
getHasMoreResults in interface PagedResponse
Returns:
true if there are more results. Returns false if all results have already been retrieved

setGroupCount

public void setGroupCount(int groupCount)
Sets the total group count before paging.

Parameters:
groupCount - the total group count before paging.

getItems

public java.util.List<Item> getItems()
The Items. These are the results.

Returns:
Items

setItems

public void setItems(java.util.List<Item> pItems)
Sets the items.

Parameters:
pItems - the items

getFields

public java.util.List<FieldResponse> getFields()
Returns input fields with additional information

Returns:
List of FieldResponse

setFields

public void setFields(java.util.List<FieldResponse> pFields)
Sets input fields with additional information

Parameters:
pFields - input fields with additional information

getDocSort

public atg.search.routing.command.search.DocSortCommon getDocSort()
Returns the docSort

Returns:
docSort

setDocSort

public void setDocSort(atg.search.routing.command.search.DocSortCommon docSort)
Sets the docsort

Parameters:
docSort - the docsort

getDocSortProp

public java.lang.String getDocSortProp()
Returns the doc sort property

Returns:
doc sort property

setDocSortProp

public void setDocSortProp(java.lang.String docSortProp)
Sets the doc sort property

Parameters:
docSortProp - the doc sort property

getDocSortPropDefault

public java.lang.String getDocSortPropDefault()
Returns the doc sort property default

Returns:
doc sort property default

setDocSortPropDefault

public void setDocSortPropDefault(java.lang.String docSortPropDefault)
Sets the doc sort property default

Parameters:
docSortPropDefault - the doc sort property default

getDocSortOrder

public TreeQueryRequest.DocSortOrder getDocSortOrder()
Returns the doc sort order

Returns:
the doc sort order

setDocSortOrder

public void setDocSortOrder(TreeQueryRequest.DocSortOrder docSortOrder)
Sets the doc sort order

Parameters:
docSortOrder - the doc sort order