atg.search.routing.command.search
Class Result

java.lang.Object
  extended by atg.search.routing.command.SearchXMLObject
      extended by atg.search.routing.command.search.Result
All Implemented Interfaces:
Groupable, java.io.Serializable

public class Result
extends atg.search.routing.command.SearchXMLObject
implements Groupable, java.io.Serializable

A single result (answer) in QueryRequest.Response, SimilarDocsRequest.Response, or StructuredQueryRequest.Response. A Result is one-to-one with a document. It is an element of a group: see AnswerGroup, although answer groups are only accessible via SearchResultsResponse.getGroups().

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
Result()
           
 
Method Summary
 atg.search.routing.command.search.InternalAnswerGroup createNewAnswerGroup()
          Returns a new internal answer group for this result.
 boolean equals(java.lang.Object pObject)
           
 int getAnswerGroup()
          Returns the answer group for this result
protected  void getAttributeXML(java.lang.StringBuilder sb)
           
protected  void getBodyXML(java.lang.StringBuilder sb)
           
 java.lang.String getContentId()
          Returns the content id of partition this came from
 java.lang.String getDebugInfo()
          Debugging information about this result
 Document getDocument()
          Document of the result
 java.lang.String getExcluded()
          Returns the name:ID of the rule that WOULD have excluded this result if exclusion rules were enabled
 int getExcludedId()
          Returns the id portion of the excluded name:id pair
 java.lang.String getExcludedName()
          Returns the name portion of the excluded name:id pair
 java.lang.String getFeatures()
          Any auxilliary statement features
 java.lang.String getField()
          The structured statement ID
 int getId()
          Result index in this response
 java.lang.String getMoveRule()
          Returns the name:ID of the rule that moved this result to this position
 int getMoveRuleId()
          Returns the id portion of the move rule
 java.lang.String getMoveRuleName()
          Returns the name portion of the move rule
 int getOriginalAnswerGroup()
          Returns the original answer group, prior to the merge
 SearchResultsResponse getParentResponse()
          Returns a reference to the parent response that encloses this
 RankConfigCalculation getRankConfig()
          Returns the rank config calculation when debug is enabled on the request
 java.lang.String getRequestTag()
          Gets the xml element tag used in the request
 float getScore()
          Relevancy of result
 java.lang.String getSortProp()
          When the request specified group-by-property, this returns the sort property
 java.lang.String getText()
          Returns the first matching statement text of the result.
 java.util.List<TextMatch> getTextMatches()
          Returns the list of TextMatches for this result.
 java.lang.String getType()
          Type of result, generally the name of the statement field for structured content, SENTENCE for unstructured, and PREFANSWER for preferred answers
 void setAnswerGroup(int answerGroup)
          Sets this result's answer group
 void setContentId(java.lang.String contentId)
          Sets the content id of partition this came from
 void setDebugInfo(java.lang.String debugInfo)
          Sets debug info from the engine
 void setDocument(Document document)
          Sets the document for this result
 void setExcluded(java.lang.String pExcluded)
          Sets the excluded rule
 void setFeatures(java.lang.String features)
          Sets auxilliary statement features
 void setField(java.lang.String field)
          Sets the structured statement ID
 void setId(int id)
          Sets the result index in this response
 void setMoveRule(java.lang.String pMoveRule)
          Sets the move rule
 void setParentResponse(SearchResultsResponse pParentResponse)
          Sets a reference to the parent response that encloses this
 void setRankConfig(RankConfigCalculation pRankConfig)
          Sets the rank config calculation
 void setScore(float score)
          Sets the score
 void setSortProp(java.lang.String sortProp)
          Sets the grouping property
 void setTextMatches(java.util.List<TextMatch> pTextMatches)
          Sets the List of TextMatches for this result.
 void setType(java.lang.String type)
          Sets the type of result, generally the name of the statement field for structured content, SENTENCE for unstructured, and PREFANSWER for preferred answers
 
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, toString, 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

Result

public Result()
Method Detail

equals

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

getParentResponse

public SearchResultsResponse getParentResponse()
Returns a reference to the parent response that encloses this

Returns:
reference to the parent response that encloses this

setParentResponse

public void setParentResponse(SearchResultsResponse pParentResponse)
Sets a reference to the parent response that encloses this

Parameters:
pParentResponse - reference to the parent response that encloses this

getContentId

public java.lang.String getContentId()
Returns the content id of partition this came from

Specified by:
getContentId in interface Groupable
Returns:
content id of partition this came from

setContentId

public void setContentId(java.lang.String contentId)
Sets the content id of partition this came from

Specified by:
setContentId in interface Groupable
Parameters:
contentId - content id of index partition this came from

getScore

public float getScore()
Relevancy of result

Specified by:
getScore in interface Groupable
Returns:
Relevancy of result

setScore

public void setScore(float score)
Sets the score

Specified by:
setScore in interface Groupable
Parameters:
score - the secore

getId

public int getId()
Result index in this response

Returns:
Result index in this response

setId

public void setId(int id)
Sets the result index in this response

Specified by:
setId in interface Groupable
Parameters:
id - result index in this response

createNewAnswerGroup

public atg.search.routing.command.search.InternalAnswerGroup createNewAnswerGroup()
Description copied from interface: Groupable
Returns a new internal answer group for this result. Only used internally.

Specified by:
createNewAnswerGroup in interface Groupable
Returns:
a new internal answer group

getAnswerGroup

public int getAnswerGroup()
Description copied from interface: Groupable
Returns the answer group for this result

Specified by:
getAnswerGroup in interface Groupable
Returns:
the answer group for this result

setAnswerGroup

public void setAnswerGroup(int answerGroup)
Description copied from interface: Groupable
Sets this result's answer group

Specified by:
setAnswerGroup in interface Groupable
Parameters:
answerGroup - the answer group

getOriginalAnswerGroup

public int getOriginalAnswerGroup()
Description copied from interface: Groupable
Returns the original answer group, prior to the merge

Specified by:
getOriginalAnswerGroup in interface Groupable
Returns:
the original answer group, prior to the merge

getType

public java.lang.String getType()
Type of result, generally the name of the statement field for structured content, SENTENCE for unstructured, and PREFANSWER for preferred answers

Returns:
Type of result, generally the name of the statement field for structured content, SENTENCE for unstructured, and PREFANSWER for preferred answers

setType

public void setType(java.lang.String type)
Sets the type of result, generally the name of the statement field for structured content, SENTENCE for unstructured, and PREFANSWER for preferred answers

Parameters:
type - the type of result, generally the name of the statement field for structured content, SENTENCE for unstructured, and PREFANSWER for preferred answers

getField

public java.lang.String getField()
The structured statement ID

Returns:
The structured statement ID

setField

public void setField(java.lang.String field)
Sets the structured statement ID

Parameters:
field - the structured statement ID

getSortProp

public java.lang.String getSortProp()
Description copied from interface: Groupable
When the request specified group-by-property, this returns the sort property

Specified by:
getSortProp in interface Groupable
Returns:
sort property

setSortProp

public void setSortProp(java.lang.String sortProp)
Sets the grouping property

Parameters:
sortProp - the grouping property

getFeatures

public java.lang.String getFeatures()
Any auxilliary statement features

Returns:
Any auxilliary statement features

setFeatures

public void setFeatures(java.lang.String features)
Sets auxilliary statement features

Parameters:
features - auxilliary statement features

getText

public java.lang.String getText()
Returns the first matching statement text of the result. See getTextMatches().

Returns:
the first matching statement text of the result

getTextMatches

public java.util.List<TextMatch> getTextMatches()
Returns the list of TextMatches for this result. See getText().

Returns:
List of TextMatches for this result

setTextMatches

public void setTextMatches(java.util.List<TextMatch> pTextMatches)
Sets the List of TextMatches for this result.

Parameters:
pTextMatches -

getDocument

public Document getDocument()
Document of the result

Specified by:
getDocument in interface Groupable
Returns:
Document of the result

setDocument

public void setDocument(Document document)
Sets the document for this result

Parameters:
document - the document

getDebugInfo

public java.lang.String getDebugInfo()
Debugging information about this result

Returns:
Debugging information about this result

setDebugInfo

public void setDebugInfo(java.lang.String debugInfo)
Sets debug info from the engine

Parameters:
debugInfo - debug info from the engine

setRankConfig

public void setRankConfig(RankConfigCalculation pRankConfig)
Sets the rank config calculation

Parameters:
pRankConfig - the rank config calculation

getRankConfig

public RankConfigCalculation getRankConfig()
Returns the rank config calculation when debug is enabled on the request

Returns:
rank config calculation when debug is enabled on the request

setMoveRule

public void setMoveRule(java.lang.String pMoveRule)
Sets the move rule

Parameters:
pMoveRule - the move rule

setExcluded

public void setExcluded(java.lang.String pExcluded)
Sets the excluded rule

Parameters:
pExcluded -

getMoveRule

public java.lang.String getMoveRule()
Returns the name:ID of the rule that moved this result to this position

Returns:
The name:ID of the rule that moved this result to this position

getExcluded

public java.lang.String getExcluded()
Returns the name:ID of the rule that WOULD have excluded this result if exclusion rules were enabled

Returns:
The name:ID of the rule that WOULD have excluded this result if exclusion rules were enabled

getMoveRuleName

public java.lang.String getMoveRuleName()
Returns the name portion of the move rule

Returns:
the name portion of the move rule

getMoveRuleId

public int getMoveRuleId()
Returns the id portion of the move rule

Returns:
the id portion of the move rule

getExcludedName

public java.lang.String getExcludedName()
Returns the name portion of the excluded name:id pair

Returns:
name portion of the excluded name:id pair

getExcludedId

public int getExcludedId()
Returns the id portion of the excluded name:id pair

Returns:
id portion of the excluded name:id pair

getRequestTag

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

Specified by:
getRequestTag in class atg.search.routing.command.SearchXMLObject
Returns:
xml element tag

getAttributeXML

protected void getAttributeXML(java.lang.StringBuilder sb)
                        throws atg.search.routing.command.IncompleteCommandException
Overrides:
getAttributeXML in class atg.search.routing.command.SearchXMLObject
Throws:
atg.search.routing.command.IncompleteCommandException

getBodyXML

protected void getBodyXML(java.lang.StringBuilder sb)
                   throws atg.search.routing.command.IncompleteCommandException
Overrides:
getBodyXML in class atg.search.routing.command.SearchXMLObject
Throws:
atg.search.routing.command.IncompleteCommandException