public class JSONResponse extends QueryableResponse
FUSION_NODEDEFAULT_CHARSET| Constructor and Description |
|---|
JSONResponse() |
JSONResponse(Map<String,Object> tree) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendMultiMap(String name,
MultivaluedMap<String,String> params) |
void |
appendObject(String name,
Object value) |
void |
appendString(String name,
String value) |
void |
appendStringList(String name,
List<String> values) |
static JSONResponse |
create(InputStream is) |
static JSONResponse |
create(String json) |
Optional<String> |
getContentCharset() |
Optional<String> |
getContentType() |
Optional<String> |
getCursorMark() |
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.
|
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).
|
List<String> |
getGroupValues()
If group=true, return an ordered list of group values
|
List<String> |
getGroupValues(String groupField)
If group=true, return an ordered list of group values
|
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.
|
Optional<Double> |
getMaxScore()
Return Solr maxScore
|
Optional<MediaType> |
getMediaType() |
Optional<Long> |
getNumFound()
Return Solr numFound
|
Optional<Long> |
getQTime()
Return Solr QTime
|
Map<String,Object> |
getResponseHeaderParams()
Get params in responseHeader
Makes defensive copies, detached from underlying response object.
|
Optional<Long> |
getStart() |
Optional<Long> |
getTotalTime()
Return Fusion Query Pipeline time
|
Map<String,Object> |
getUnderlyingObject() |
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
|
void |
reorderGroupValues(String groupField,
List<String> groupValues)
Reorder group values in the response.
|
void |
setNumFound(Long numFound) |
void |
setStart(Long start) |
boolean |
setTotalTime(Long time)
Set Fusion Query Pipeline time if and only if the responseHeader object already exists.
|
void |
updateFacets(Map<String,Map<String,Object>> facets)
Update facets in underlying response object
|
void |
updateHighlighting(Map<String,Map<String,Object>> highlighting)
Update highlighting in underlying response object
|
boolean |
updateResponseHeaderParams(Map<String,Object> responseHeaderParams)
Update responseHeader params if and only if responseHeader already exists.
|
void |
write(OutputStream os) |
iterate, matches, querygetDocIds, getDocIds, getDocuments, getDocumentsForGroupValue, getDocumentsForGroupValue, toByteArray, toString, updateDocuments, updateDocumentsForGroupValue, updateDocumentsForGroupValuepublic static JSONResponse create(String json) throws IOException
IOExceptionpublic static JSONResponse create(InputStream is) throws IOException
IOExceptionpublic void appendString(String name, String value)
appendString in class AbstractResponsepublic void appendStringList(String name, List<String> values)
appendStringList in class AbstractResponsepublic void appendMultiMap(String name, MultivaluedMap<String,String> params)
appendMultiMap in class AbstractResponsepublic void write(OutputStream os) throws IOException
IOExceptionpublic Map<String,Object> getUnderlyingObject()
getUnderlyingObject in class AbstractResponsepublic Optional<Long> getQTime()
AbstractResponsegetQTime in class AbstractResponsepublic Optional<Long> getTotalTime()
AbstractResponsegetTotalTime in class AbstractResponsepublic boolean setTotalTime(Long time)
AbstractResponsesetTotalTime in class AbstractResponsepublic Optional<Long> getNumFound()
AbstractResponsegetNumFound in class AbstractResponsepublic void setNumFound(Long numFound)
setNumFound in class AbstractResponsepublic Optional<Double> getMaxScore()
AbstractResponsegetMaxScore in class AbstractResponsepublic Optional<Long> getStart()
getStart in class AbstractResponsepublic Optional<String> getCursorMark()
getCursorMark in class AbstractResponsepublic void setStart(Long start)
setStart in class AbstractResponsepublic Map<String,Object> getResponseHeaderParams()
AbstractResponseAbstractResponse.updateResponseHeaderParams(Map) ()} to commit the changes to the
actual underlying response object.getResponseHeaderParams in class AbstractResponsepublic boolean updateResponseHeaderParams(Map<String,Object> responseHeaderParams)
AbstractResponseupdateResponseHeaderParams in class AbstractResponsepublic boolean isGrouped()
AbstractResponseisGrouped in class AbstractResponsepublic List<String> getGroupValues()
AbstractResponsegetGroupValues in class AbstractResponsepublic List<String> getGroupValues(String groupField)
AbstractResponsegetGroupValues in class AbstractResponsepublic List<Map<String,Object>> getGroups(String groupField)
AbstractResponseAbstractResponse#updateGroups(String, List).getGroups in class AbstractResponsepublic void reorderGroupValues(String groupField, List<String> groupValues)
AbstractResponsereorderGroupValues in class AbstractResponsegroupField - group fieldgroupValues - a list of all group values in the desired orderpublic Map<String,Map<String,Object>> getHighlighting()
AbstractResponseAbstractResponse.updateHighlighting(Map) to commit the changes to the
actual underlying response object.getHighlighting in class AbstractResponsepublic void updateHighlighting(Map<String,Map<String,Object>> highlighting)
AbstractResponseupdateHighlighting in class AbstractResponsepublic Map<String,Map<String,Object>> getFacets()
AbstractResponseAbstractResponse.updateFacets(Map) to commit the changes to the
actual underlying response object.getFacets in class AbstractResponsepublic void updateFacets(Map<String,Map<String,Object>> facets)
AbstractResponseupdateFacets in class AbstractResponse