Class QueryResponse
- java.lang.Object
-
- com.attivio.sdk.esb.AbstractPlatformMessage
-
- com.attivio.sdk.search.QueryResponse
-
- All Implemented Interfaces:
PlatformMessage,java.io.Serializable,java.lang.Cloneable
public class QueryResponse extends AbstractPlatformMessage implements java.io.Serializable
QueryResponse contains the response to aQueryRequest.The response may contain any of the following based on the initial request:
- The
QueryRequestafter modifications by all query request/response transformers. NOTE: this should NOT be reused. - The documents that matched the query inside a
SearchDocumentList - The facet results if any were requested.
- Any query feedback generated by query/response transformers. These could contain spelling suggestions, or information messages about any processing that took place.
- Basic timing information about how long various part of the search took.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSPELLCHECK_SUGGESTEDThe response property containing the spellcheck suggested querystatic java.lang.StringSPELLCHECK_SUGGESTED_MARKEDUPThe response property containing the marked up spellcheck suggested querystatic java.lang.StringSTATISTICS_LINGUISTICS_INFOThe response property containing the query linguistics infostatic java.lang.StringSTATISTICS_QUERY_INFOThe response property containing the query statisticsstatic java.lang.StringTERMCOUNTCHECK_REPORTThe response property containing the term count check report-
Fields inherited from interface com.attivio.sdk.esb.PlatformMessage
DEFAULT_MAX_LOG_LENGTH, MESSAGE_DROPPED, MESSAGE_SEND_TIME_PROP, PROP_MAX_LOG_LENGTH
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedQueryResponse()QueryResponse(QueryRequest request)Creates a new QueryResponse from a QueryRequest object.QueryResponse(java.util.UUID clientId, WorkflowQueue workflows)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFacet(FacetResponse value)Add a facet to the response.QueryFeedbackaddFeedback(QueryFeedback message)Add a feedback message.voidaddFeedback(QueryFeedback... value)Add multiple feedback messages.QueryFeedbackaddFeedback(java.lang.String stageName, java.lang.String messageName, java.lang.String message)Add a feedback message.QueryFeedbackaddFeedback(java.lang.String stageName, java.lang.String messageName, java.lang.String message, java.util.Map<java.lang.String,java.lang.Object> properties)Add a feedback message.voidaddFeedback(java.util.List<QueryFeedback> value)Add multiple feedback messages.voidaddPlacement(QueryPlacement value)QueryResponseclone()Clones the object and resets message ID to -1.booleanequals(java.lang.Object other)SearchDocumentListgetDocuments()Get the documents returned for this response.FacetResponsegetFacet(java.lang.String name)Gets a facet by name.java.util.List<FacetResponse>getFacets()Get the generated facets for this response.longgetFacetTime()Get the number of milliseconds taken to compute facets.java.util.List<QueryFeedback>getFeedback()Get all feedback messages for this response.java.util.List<QueryFeedback>getFeedbackByMessageName(java.lang.String messageName)Get all query feedback that has a message specific message name.longgetHighlightTime()Get the number of milliseconds taken to highlight results.java.util.List<QueryPlacement>getPlacements()Get all placements for this response.QueryRequestgetQueryRequest()Get theQueryRequestfor this response.longgetQueryTimestamp()Get the timestamp the query was receivedlonggetResponseTime()The total time spent processing a request including network and serialization time in milliseconds.longgetResultTime()Get the number of milliseconds taken to generate results.java.lang.StringgetSchemaName()Get the schema name specified for the request.longgetSearchTime()Get the number of milliseconds taken to execute the search.longgetTotalRows()Gets the total number of rows that matched the query.longgetWorkflowTime()Get the number of milliseconds spent in workflow stages.inthashCode()voidsetDocuments(SearchDocumentList value)Set the documents to return with this repsonse.voidsetFacets(FacetResponse... value)Set the generated facets for this response.voidsetFacets(java.util.List<FacetResponse> value)Set the generated facets for this response.voidsetFacetTime(long time)Set the number of milliseconds taken to compute facets.voidsetFeedback(java.util.List<QueryFeedback> value)voidsetHighlightTime(long time)Set the number of milliseconds taken to highlight results.voidsetPlacements(java.util.List<QueryPlacement> value)voidsetQueryRequest(QueryRequest value)Set theQueryRequestfor this response.voidsetQueryTimestamp(long queryTime)Set the timestamp the query was receivedvoidsetResultTime(long time)Set the number of milliseconds taken to generate results.voidsetSearchTime(long time)Set the number of milliseconds taken to execute the search.voidsetWorkflowTime(long time)Set the number of milliseconds spent in workflow stages.protected java.lang.StringBuildertoString(java.lang.StringBuilder buffer)Append the string form of this request tobuffer.-
Methods inherited from class com.attivio.sdk.esb.AbstractPlatformMessage
addMessageHistory, addMessageHistory, getClientId, getEstimatedSize, getMessageHistory, getMessageId, getMetadata, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getWorkflowQueue, getWorkflowQueue, hasProperty, isRedelivered, removeProperty, removeWorkflowQueue, setClientId, setMessageId, setProperty, setRedelivered, setWorkflowQueue, setWorkflowQueue, toMessageString, toString, toString, toString, toString, toString, toString, toString, toString, toString
-
-
-
-
Field Detail
-
SPELLCHECK_SUGGESTED
public static final java.lang.String SPELLCHECK_SUGGESTED
The response property containing the spellcheck suggested query- See Also:
- Constant Field Values
-
SPELLCHECK_SUGGESTED_MARKEDUP
public static final java.lang.String SPELLCHECK_SUGGESTED_MARKEDUP
The response property containing the marked up spellcheck suggested query- See Also:
- Constant Field Values
-
TERMCOUNTCHECK_REPORT
public static final java.lang.String TERMCOUNTCHECK_REPORT
The response property containing the term count check report- See Also:
- Constant Field Values
-
STATISTICS_QUERY_INFO
public static final java.lang.String STATISTICS_QUERY_INFO
The response property containing the query statistics- See Also:
- Constant Field Values
-
STATISTICS_LINGUISTICS_INFO
public static final java.lang.String STATISTICS_LINGUISTICS_INFO
The response property containing the query linguistics info- See Also:
- Constant Field Values
-
-
Constructor Detail
-
QueryResponse
protected QueryResponse()
-
QueryResponse
public QueryResponse(QueryRequest request)
Creates a new QueryResponse from a QueryRequest object.Any workflows set on
requestare transferred to the new query response, that is they do not remain onrequest.
-
QueryResponse
public QueryResponse(java.util.UUID clientId, WorkflowQueue workflows)
-
-
Method Detail
-
getSchemaName
public java.lang.String getSchemaName()
Get the schema name specified for the request.
-
getTotalRows
public long getTotalRows()
Gets the total number of rows that matched the query.
-
getDocuments
public SearchDocumentList getDocuments()
Get the documents returned for this response.NOTE: this will only contain a "window" over the total result set based on the requested number of rows and offset requested.
-
setDocuments
public void setDocuments(SearchDocumentList value)
Set the documents to return with this repsonse.
-
getQueryRequest
public QueryRequest getQueryRequest()
Get theQueryRequestfor this response.NOTE: this may be null in order to optimize network traffic.
-
setQueryRequest
public void setQueryRequest(QueryRequest value)
Set theQueryRequestfor this response.
-
getWorkflowTime
public long getWorkflowTime()
Get the number of milliseconds spent in workflow stages.This is the total time spent during workflow processing. This included search time/facet time/response time.
-
setWorkflowTime
public void setWorkflowTime(long time)
Set the number of milliseconds spent in workflow stages.
-
getResponseTime
public long getResponseTime()
The total time spent processing a request including network and serialization time in milliseconds.
-
getSearchTime
public long getSearchTime()
Get the number of milliseconds taken to execute the search.This time only takes into account the time spent matching and ordering results.
-
setSearchTime
public void setSearchTime(long time)
Set the number of milliseconds taken to execute the search.
-
getFacetTime
public long getFacetTime()
Get the number of milliseconds taken to compute facets.
-
setFacetTime
public void setFacetTime(long time)
Set the number of milliseconds taken to compute facets.
-
getResultTime
public long getResultTime()
Get the number of milliseconds taken to generate results.This is the time taken to create the
SearchDocuments for the response.
-
setResultTime
public void setResultTime(long time)
Set the number of milliseconds taken to generate results.
-
getHighlightTime
public long getHighlightTime()
Get the number of milliseconds taken to highlight results.NOTE: this is the total CPU time spent during highlighting. This may be greater than the wall clock time in the case of multi-column installations.
-
setHighlightTime
public void setHighlightTime(long time)
Set the number of milliseconds taken to highlight results.
-
getQueryTimestamp
public long getQueryTimestamp()
Get the timestamp the query was received- Returns:
- timestamp
-
setQueryTimestamp
public void setQueryTimestamp(long queryTime)
Set the timestamp the query was received
-
getFacets
public java.util.List<FacetResponse> getFacets()
Get the generated facets for this response.NOTE: this method will never return
null.
-
getFacet
public FacetResponse getFacet(java.lang.String name)
Gets a facet by name.- Returns:
- a facet response, or null if the facet is not found
-
setFacets
public void setFacets(java.util.List<FacetResponse> value)
Set the generated facets for this response.
-
setFacets
public void setFacets(FacetResponse... value)
Set the generated facets for this response.
-
addFacet
public void addFacet(FacetResponse value)
Add a facet to the response.
-
getPlacements
public java.util.List<QueryPlacement> getPlacements()
Get all placements for this response.
-
setPlacements
public void setPlacements(java.util.List<QueryPlacement> value)
-
addPlacement
public void addPlacement(QueryPlacement value)
-
getFeedback
public java.util.List<QueryFeedback> getFeedback()
Get all feedback messages for this response.
-
setFeedback
public void setFeedback(java.util.List<QueryFeedback> value)
-
getFeedbackByMessageName
public java.util.List<QueryFeedback> getFeedbackByMessageName(java.lang.String messageName)
Get all query feedback that has a message specific message name.
-
addFeedback
public QueryFeedback addFeedback(QueryFeedback message)
Add a feedback message.
-
addFeedback
public void addFeedback(java.util.List<QueryFeedback> value)
Add multiple feedback messages.
-
addFeedback
public void addFeedback(QueryFeedback... value)
Add multiple feedback messages.
-
addFeedback
public QueryFeedback addFeedback(java.lang.String stageName, java.lang.String messageName, java.lang.String message)
Add a feedback message.
-
addFeedback
public QueryFeedback addFeedback(java.lang.String stageName, java.lang.String messageName, java.lang.String message, java.util.Map<java.lang.String,java.lang.Object> properties)
Add a feedback message.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractPlatformMessage
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classAbstractPlatformMessage
-
toString
protected java.lang.StringBuilder toString(java.lang.StringBuilder buffer)
Append the string form of this request tobuffer.- Overrides:
toStringin classAbstractPlatformMessage
-
clone
public QueryResponse clone()
Clones the object and resets message ID to -1. Clones a message. The message ID is not cloned.- Specified by:
clonein interfacePlatformMessage- Overrides:
clonein classAbstractPlatformMessage- Returns:
- the cloned index message
-
-