public abstract class AbstractResponse extends Object implements WriteableResponse
Modifier and Type | Field and Description |
---|---|
static String |
FUSION_NODE |
DEFAULT_CHARSET
Constructor and Description |
---|
AbstractResponse() |
Modifier and Type | Method and Description |
---|---|
abstract void |
appendMultiMap(String name,
MultivaluedMap<String,String> params) |
abstract void |
appendString(String name,
String value) |
abstract void |
appendStringList(String name,
List<String> values) |
abstract Optional<String> |
getCursorMark() |
List<String> |
getDocIds()
Convenience method for returning all doc ids
|
abstract List<String> |
getDocIds(String id) |
abstract List<Map<String,Object>> |
getDocumentFieldValuesForCollapseExpandGroupValue(String groupField,
String groupValue)
Return documents of a specific group value under both "response/doc" and "expanded" sections in response
Makes defensive copies, detached from underlying response object.
|
abstract List<Map<String,Object>> |
getDocumentFieldValuesForGroupValue(String groupField,
String groupValue) |
List<ResponseDocument> |
getDocuments()
Returns documents.
|
List<ResponseDocument> |
getDocumentsForGroupValue(String groupValue)
Deprecated.
|
List<ResponseDocument> |
getDocumentsForGroupValue(String groupField,
String groupValue)
Returns documents (corresponding to groupValue)
Makes defensive copies, detached from underlying response object.
|
abstract Map<String,Map<String,Object>> |
getExpandedResults()
Returns all collapse expanded results as a map of collapse field name to grouping data that includes list of docs
|
abstract Map<String,Map<String,Object>> |
getFacets()
Return facet info as nested objects: {facet type -> field name -> facet count entries}
NOTE: The actual Java type of facet count entries may differ between implementations.
|
abstract Map<String,Map<String,Object>> |
getGroupedResults()
Returns all grouped results as a map of
string grouped expression (a field name or a query) to grouping data that includes list of groups
For comparison getGroups(String groupField) returns a list of groups for a particular grouping expresion
|
abstract List<Map<String,Object>> |
getGroups(String groupField)
Return groups in the response with all accompanying document data
Each list entry contains information about the groupValue and the Solr doclist (which includes the docs as well as
numFound and rows info).
|
abstract List<String> |
getGroupValues()
Deprecated.
|
abstract List<String> |
getGroupValues(String groupField)
If group=true, return an ordered list of group values
|
abstract Map<String,Map<String,Object>> |
getHighlighting()
Return highlighting info as nested objects: {Doc ID -> Field name -> Snippets}
Makes defensive copies, detached from underlying response object.
|
abstract Optional<Double> |
getMaxScore()
Return Solr maxScore
|
abstract Optional<Long> |
getNumFound()
Return Solr numFound
|
abstract Optional<Long> |
getQTime()
Return Solr QTime
|
abstract Map<String,Object> |
getResponseHeaderParams()
Get params in responseHeader
Makes defensive copies, detached from underlying response object.
|
abstract Map<String,Object> |
getSpellcheck()
Returns response of Solr spellcheck handler
|
abstract Optional<Long> |
getStart() |
abstract Optional<Long> |
getTotalTime()
Return Fusion Query Pipeline time
|
abstract Object |
getUnderlyingObject() |
abstract boolean |
isGrouped()
Checks to see if response is grouped (group=true Solr parameter)
See https://lucene.apache.org/solr/guide/7_4/result-grouping.html
|
abstract void |
reorderGroupValues(String groupField,
List<String> groupValues)
Reorder group values in the response.
|
abstract void |
setNumFound(Long numFound) |
abstract void |
setStart(Long start) |
abstract boolean |
setTotalTime(Long time)
Set Fusion Query Pipeline time if and only if the responseHeader object already exists.
|
byte[] |
toByteArray() |
String |
toString() |
abstract void |
updateDocumentFieldValuesForCollapseExpandGroupValue(String groupField,
String groupValue,
List<Map<String,Object>> updatedDocuments)
Update documents (corresponding to groupValue) in underlying response object
The list of updatedDocuments should include all documents under the groupValue
as this method updates both "response/doc" and "expanded" sections in response
The list of updatedDocuments cannot be empty
|
abstract void |
updateDocumentFieldValuesForGroupValue(String groupField,
String groupValue,
List<Map<String,Object>> updatedDocuments) |
void |
updateDocuments(List<ResponseDocument> updatedDocuments)
Update documents in underlying response object
Use this method to commit changes (like reordering, redactions, rewritings) made to document
objects returned from
getDocuments() |
void |
updateDocumentsForGroupValue(String groupValue,
List<ResponseDocument> updatedDocuments)
Deprecated.
|
void |
updateDocumentsForGroupValue(String groupField,
String groupValue,
List<ResponseDocument> updatedDocuments)
Update documents (corresponding to groupValue) in underlying response object
|
abstract void |
updateFacets(Map<String,Map<String,Object>> facets)
Update facets in underlying response object
|
abstract void |
updateHighlighting(Map<String,Map<String,Object>> highlighting)
Update highlighting in underlying response object
|
abstract boolean |
updateResponseHeaderParams(Map<String,Object> responseHeaderParams)
Update responseHeader params if and only if responseHeader already exists.
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getContentCharset, getContentType, getMediaType, write
public static final String FUSION_NODE
public abstract void appendMultiMap(String name, MultivaluedMap<String,String> params)
public abstract Object getUnderlyingObject()
public abstract Optional<Long> getTotalTime()
public abstract boolean setTotalTime(Long time)
public abstract void setNumFound(Long numFound)
public abstract void setStart(Long start)
public abstract Map<String,Object> getResponseHeaderParams()
updateResponseHeaderParams(Map)
()} to commit the changes to the
actual underlying response object.public abstract boolean updateResponseHeaderParams(Map<String,Object> responseHeaderParams)
public List<ResponseDocument> getDocuments()
updateDocuments(List)
to commit the changes to the
actual underlying response object.public void updateDocuments(List<ResponseDocument> updatedDocuments)
getDocuments()
updatedDocuments
- public abstract boolean isGrouped()
@Deprecated public abstract List<String> getGroupValues()
getGroupValues(String)
public abstract List<String> getGroupValues(String groupField)
groupField
- @Deprecated public List<ResponseDocument> getDocumentsForGroupValue(String groupValue)
getDocumentsForGroupValue(String, String)
updateDocumentsForGroupValue(String, List)
to commit the changes to the
actual underlying response object.groupValue
- public List<ResponseDocument> getDocumentsForGroupValue(String groupField, String groupValue)
updateDocumentsForGroupValue(String, String, List)
to commit the changes to the
actual underlying response object.groupField
- groupValue
- public abstract List<Map<String,Object>> getDocumentFieldValuesForGroupValue(String groupField, String groupValue)
public abstract List<Map<String,Object>> getDocumentFieldValuesForCollapseExpandGroupValue(String groupField, String groupValue)
updateDocumentFieldValuesForCollapseExpandGroupValue(String, String, List)
to persist the changes to the
actual underlying response object.groupField
- groupValue
- @Deprecated public void updateDocumentsForGroupValue(String groupValue, List<ResponseDocument> updatedDocuments)
updateDocumentsForGroupValue(String, String, List)
groupValue
- updatedDocuments
- public void updateDocumentsForGroupValue(String groupField, String groupValue, List<ResponseDocument> updatedDocuments)
groupField
- groupValue
- updatedDocuments
- public abstract void updateDocumentFieldValuesForCollapseExpandGroupValue(String groupField, String groupValue, List<Map<String,Object>> updatedDocuments)
groupField
- groupValue
- updatedDocuments
- public abstract void updateDocumentFieldValuesForGroupValue(String groupField, String groupValue, List<Map<String,Object>> updatedDocuments)
public abstract Map<String,Map<String,Object>> getGroupedResults()
public abstract Map<String,Map<String,Object>> getExpandedResults()
public abstract List<Map<String,Object>> getGroups(String groupField)
public abstract void reorderGroupValues(String groupField, List<String> groupValues)
groupField
- group fieldgroupValues
- a list of all group values in the desired orderpublic abstract Map<String,Map<String,Object>> getHighlighting()
updateHighlighting(Map)
to commit the changes to the
actual underlying response object.public abstract void updateHighlighting(Map<String,Map<String,Object>> highlighting)
highlighting
- public abstract Map<String,Map<String,Object>> getFacets()
updateFacets(Map)
to commit the changes to the
actual underlying response object.public abstract void updateFacets(Map<String,Map<String,Object>> facets)
facets
- public abstract Map<String,Object> getSpellcheck()
public byte[] toByteArray() throws IOException
IOException