Class RawResponse
- java.lang.Object
- 
- com.lucidworks.apollo.solr.response.AbstractResponse
- 
- com.lucidworks.apollo.solr.response.RawResponse
 
 
- 
- All Implemented Interfaces:
- WriteableResponse,- java.io.Closeable,- java.lang.AutoCloseable
 
 public class RawResponse extends AbstractResponse implements java.io.Closeable This represents a response that we do not know the contents of. It is a type that we do not know how to parse.
- 
- 
Field Summary- 
Fields inherited from class com.lucidworks.apollo.solr.response.AbstractResponseFUSION_NODE
 - 
Fields inherited from interface com.lucidworks.apollo.solr.response.WriteableResponseDEFAULT_CHARSET
 
- 
 - 
Constructor SummaryConstructors Constructor Description RawResponse(java.io.InputStream rawResponse, java.lang.String contentType, java.lang.String charset)RawResponse(java.io.InputStream rawResponse, java.lang.String contentType, java.lang.String charset, boolean failOnUnimplementedMethods)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendMultiMap(java.lang.String name, MultivaluedMap<java.lang.String,java.lang.String> params)voidappendString(java.lang.String name, java.lang.String value)voidappendStringList(java.lang.String name, java.util.List<java.lang.String> values)voidclose()static RawResponsecreate(java.io.InputStream rawResponse, java.lang.String contentType, java.util.Optional<java.nio.charset.Charset> charset)static RawResponsecreate(java.io.InputStream rawResponse, java.util.Optional<MediaType> contentType, java.util.Optional<java.nio.charset.Charset> charset)static RawResponsecreate(java.lang.String stringResponse, java.util.Optional<MediaType> contentType, java.util.Optional<java.nio.charset.Charset> charset)java.util.Optional<java.lang.String>getContentCharset()java.util.Optional<java.lang.String>getContentType()java.util.Optional<java.lang.String>getCursorMark()java.util.List<java.lang.String>getDocIds(java.lang.String id)java.util.List<java.util.Map<java.lang.String,java.lang.Object>>getDocumentFieldValuesForCollapseExpandGroupValue(java.lang.String groupField, java.lang.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.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>getDocumentFieldValuesForGroupValue(java.lang.String groupField, java.lang.String groupValue)java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>getExpandedResults()Returns all collapse expanded results as a map of collapse field name to grouping data that includes list of docsjava.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.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.java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.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 expresionjava.util.List<java.util.Map<java.lang.String,java.lang.Object>>getGroups(java.lang.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).java.util.List<java.lang.String>getGroupValues()If group=true, return an ordered list of group valuesjava.util.List<java.lang.String>getGroupValues(java.lang.String groupField)If group=true, return an ordered list of group valuesjava.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>getHighlighting()Return highlighting info as nested objects: {Doc ID -> Field name -> Snippets} Makes defensive copies, detached from underlying response object.java.util.Map<java.lang.String,java.lang.Object>getJsonFacets()java.util.Optional<java.lang.Double>getMaxScore()Return Solr maxScorejava.util.Optional<MediaType>getMediaType()java.util.Optional<java.lang.Long>getNumFound()Return Solr numFoundjava.util.Optional<java.lang.Long>getQTime()Return Solr QTimejava.io.InputStreamgetRawResponse()java.util.Map<java.lang.String,java.lang.Object>getResponseHeaderParams()Get params in responseHeader Makes defensive copies, detached from underlying response object.java.util.Map<java.lang.String,java.lang.Object>getSpellcheck()Returns response of Solr spellcheck handlerjava.util.Optional<java.lang.Long>getStart()java.util.Optional<java.lang.Long>getTotalTime()Return Fusion Query Pipeline timejava.lang.ObjectgetUnderlyingObject()booleanisGrouped()Checks to see if response is grouped (group=true Solr parameter) See https://lucene.apache.org/solr/guide/7_4/result-grouping.htmlvoidreorderGroupValues(java.lang.String groupField, java.util.List<java.lang.String> groupValues)Reorder group values in the response.voidsetNumFound(java.lang.Long numFound)voidsetStart(java.lang.Long start)booleansetTotalTime(java.lang.Long time)Set Fusion Query Pipeline time if and only if the responseHeader object already exists.voidupdateDocumentFieldValuesForCollapseExpandGroupValue(java.lang.String groupField, java.lang.String groupValue, java.util.List<java.util.Map<java.lang.String,java.lang.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 emptyvoidupdateDocumentFieldValuesForGroupValue(java.lang.String groupField, java.lang.String groupValue, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> updatedDocuments)voidupdateFacets(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> facets)Update facets in underlying response objectvoidupdateHighlighting(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> highlighting)Update highlighting in underlying response objectbooleanupdateResponseHeaderParams(java.util.Map<java.lang.String,java.lang.Object> responseHeaderParams)Update responseHeader params if and only if responseHeader already exists.voidwrite(java.io.OutputStream os)- 
Methods inherited from class com.lucidworks.apollo.solr.response.AbstractResponsegetDocIds, getDocuments, getDocumentsForGroupValue, getDocumentsForGroupValue, toByteArray, toString, updateDocuments, updateDocumentsForGroupValue, updateDocumentsForGroupValue
 
- 
 
- 
- 
- 
Method Detail- 
writepublic void write(java.io.OutputStream os) throws java.io.IOException- Specified by:
- writein interface- WriteableResponse
- Throws:
- java.io.IOException
 
 - 
getContentTypepublic java.util.Optional<java.lang.String> getContentType() - Specified by:
- getContentTypein interface- WriteableResponse
 
 - 
getContentCharsetpublic java.util.Optional<java.lang.String> getContentCharset() - Specified by:
- getContentCharsetin interface- WriteableResponse
 
 - 
getMediaTypepublic java.util.Optional<MediaType> getMediaType() - Specified by:
- getMediaTypein interface- WriteableResponse
 
 - 
createpublic static RawResponse create(java.lang.String stringResponse, java.util.Optional<MediaType> contentType, java.util.Optional<java.nio.charset.Charset> charset) 
 - 
createpublic static RawResponse create(java.io.InputStream rawResponse, java.util.Optional<MediaType> contentType, java.util.Optional<java.nio.charset.Charset> charset) 
 - 
createpublic static RawResponse create(java.io.InputStream rawResponse, java.lang.String contentType, java.util.Optional<java.nio.charset.Charset> charset) 
 - 
getRawResponsepublic java.io.InputStream getRawResponse() 
 - 
closepublic void close() throws java.io.IOException- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Throws:
- java.io.IOException
 
 - 
appendStringpublic void appendString(java.lang.String name, java.lang.String value)- Specified by:
- appendStringin class- AbstractResponse
 
 - 
appendStringListpublic void appendStringList(java.lang.String name, java.util.List<java.lang.String> values)- Specified by:
- appendStringListin class- AbstractResponse
 
 - 
appendMultiMappublic void appendMultiMap(java.lang.String name, MultivaluedMap<java.lang.String,java.lang.String> params)- Specified by:
- appendMultiMapin class- AbstractResponse
 
 - 
getUnderlyingObjectpublic java.lang.Object getUnderlyingObject() - Specified by:
- getUnderlyingObjectin class- AbstractResponse
 
 - 
getQTimepublic java.util.Optional<java.lang.Long> getQTime() Description copied from class:AbstractResponseReturn Solr QTime- Specified by:
- getQTimein class- AbstractResponse
- Returns:
 
 - 
getTotalTimepublic java.util.Optional<java.lang.Long> getTotalTime() Description copied from class:AbstractResponseReturn Fusion Query Pipeline time- Specified by:
- getTotalTimein class- AbstractResponse
- Returns:
 
 - 
setTotalTimepublic boolean setTotalTime(java.lang.Long time) Description copied from class:AbstractResponseSet Fusion Query Pipeline time if and only if the responseHeader object already exists.- Specified by:
- setTotalTimein class- AbstractResponse
- Returns:
- true if update was successful
 
 - 
getNumFoundpublic java.util.Optional<java.lang.Long> getNumFound() Description copied from class:AbstractResponseReturn Solr numFound- Specified by:
- getNumFoundin class- AbstractResponse
- Returns:
 
 - 
setNumFoundpublic void setNumFound(java.lang.Long numFound) - Specified by:
- setNumFoundin class- AbstractResponse
 
 - 
getMaxScorepublic java.util.Optional<java.lang.Double> getMaxScore() Description copied from class:AbstractResponseReturn Solr maxScore- Specified by:
- getMaxScorein class- AbstractResponse
- Returns:
 
 - 
getStartpublic java.util.Optional<java.lang.Long> getStart() - Specified by:
- getStartin class- AbstractResponse
 
 - 
getCursorMarkpublic java.util.Optional<java.lang.String> getCursorMark() - Specified by:
- getCursorMarkin class- AbstractResponse
 
 - 
setStartpublic void setStart(java.lang.Long start) - Specified by:
- setStartin class- AbstractResponse
 
 - 
getResponseHeaderParamspublic java.util.Map<java.lang.String,java.lang.Object> getResponseHeaderParams() Description copied from class:AbstractResponseGet params in responseHeader Makes defensive copies, detached from underlying response object. CallAbstractResponse.updateResponseHeaderParams(Map)()} to commit the changes to the actual underlying response object.- Specified by:
- getResponseHeaderParamsin class- AbstractResponse
- Returns:
- responseHeader params
 
 - 
updateResponseHeaderParamspublic boolean updateResponseHeaderParams(java.util.Map<java.lang.String,java.lang.Object> responseHeaderParams) Description copied from class:AbstractResponseUpdate responseHeader params if and only if responseHeader already exists.- Specified by:
- updateResponseHeaderParamsin class- AbstractResponse
- Returns:
- true if update was successful
 
 - 
isGroupedpublic boolean isGrouped() Description copied from class:AbstractResponseChecks to see if response is grouped (group=true Solr parameter) See https://lucene.apache.org/solr/guide/7_4/result-grouping.html- Specified by:
- isGroupedin class- AbstractResponse
- Returns:
 
 - 
getGroupValuespublic java.util.List<java.lang.String> getGroupValues() Description copied from class:AbstractResponseIf group=true, return an ordered list of group values- Specified by:
- getGroupValuesin class- AbstractResponse
- Returns:
 
 - 
getGroupValuespublic java.util.List<java.lang.String> getGroupValues(java.lang.String groupField) Description copied from class:AbstractResponseIf group=true, return an ordered list of group values- Specified by:
- getGroupValuesin class- AbstractResponse
- Returns:
 
 - 
getDocumentFieldValuesForGroupValuepublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getDocumentFieldValuesForGroupValue(java.lang.String groupField, java.lang.String groupValue)- Specified by:
- getDocumentFieldValuesForGroupValuein class- AbstractResponse
 
 - 
getDocumentFieldValuesForCollapseExpandGroupValuepublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getDocumentFieldValuesForCollapseExpandGroupValue(java.lang.String groupField, java.lang.String groupValue)Description copied from class:AbstractResponseReturn documents of a specific group value under both "response/doc" and "expanded" sections in response Makes defensive copies, detached from underlying response object. CallAbstractResponse.updateDocumentFieldValuesForCollapseExpandGroupValue(String, String, List)to persist the changes to the actual underlying response object.- Specified by:
- getDocumentFieldValuesForCollapseExpandGroupValuein class- AbstractResponse
- Returns:
 
 - 
updateDocumentFieldValuesForGroupValuepublic void updateDocumentFieldValuesForGroupValue(java.lang.String groupField, java.lang.String groupValue, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> updatedDocuments)- Specified by:
- updateDocumentFieldValuesForGroupValuein class- AbstractResponse
 
 - 
updateDocumentFieldValuesForCollapseExpandGroupValuepublic void updateDocumentFieldValuesForCollapseExpandGroupValue(java.lang.String groupField, java.lang.String groupValue, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> updatedDocuments)Description copied from class:AbstractResponseUpdate 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- Specified by:
- updateDocumentFieldValuesForCollapseExpandGroupValuein class- AbstractResponse
 
 - 
getGroupedResultspublic java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> getGroupedResults() Description copied from class:AbstractResponseReturns 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- Specified by:
- getGroupedResultsin class- AbstractResponse
 
 - 
getExpandedResultspublic java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> getExpandedResults() Description copied from class:AbstractResponseReturns all collapse expanded results as a map of collapse field name to grouping data that includes list of docs- Specified by:
- getExpandedResultsin class- AbstractResponse
 
 - 
getGroupspublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getGroups(java.lang.String groupField) Description copied from class:AbstractResponseReturn 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).- Specified by:
- getGroupsin class- AbstractResponse
 
 - 
reorderGroupValuespublic void reorderGroupValues(java.lang.String groupField, java.util.List<java.lang.String> groupValues)Description copied from class:AbstractResponseReorder group values in the response.- Specified by:
- reorderGroupValuesin class- AbstractResponse
- Parameters:
- groupField- group field
- groupValues- a list of all group values in the desired order
 
 - 
getHighlightingpublic java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> getHighlighting() Description copied from class:AbstractResponseReturn highlighting info as nested objects: {Doc ID -> Field name -> Snippets} Makes defensive copies, detached from underlying response object. CallAbstractResponse.updateHighlighting(Map)to commit the changes to the actual underlying response object.- Specified by:
- getHighlightingin class- AbstractResponse
- Returns:
 
 - 
updateHighlightingpublic void updateHighlighting(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> highlighting) Description copied from class:AbstractResponseUpdate highlighting in underlying response object- Specified by:
- updateHighlightingin class- AbstractResponse
 
 - 
getFacetspublic java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> getFacets() Description copied from class:AbstractResponseReturn 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. This is not ideal, but it would take a lot of work to support all the different variations of Solr responses that exist. At the time of this writing: - XMLResponse returns a LinkedHashMap - JSONResponse will return a List. The Java type of the list's contents will depend on what json.nl parameter was used in the Solr request. See https://lucene.apache.org/solr/guide/7_4/response-writers.html for complete list. We use Jackson to translate JSON -> Java types. Makes defensive copies, detached from underlying response object. CallAbstractResponse.updateFacets(Map)to commit the changes to the actual underlying response object.- Specified by:
- getFacetsin class- AbstractResponse
- Returns:
 
 - 
getJsonFacetspublic java.util.Map<java.lang.String,java.lang.Object> getJsonFacets() - Specified by:
- getJsonFacetsin class- AbstractResponse
 
 - 
updateFacetspublic void updateFacets(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> facets) Description copied from class:AbstractResponseUpdate facets in underlying response object- Specified by:
- updateFacetsin class- AbstractResponse
 
 - 
getSpellcheckpublic java.util.Map<java.lang.String,java.lang.Object> getSpellcheck() Description copied from class:AbstractResponseReturns response of Solr spellcheck handler- Specified by:
- getSpellcheckin class- AbstractResponse
- Returns:
- spellcheck results or empty map
 
 - 
getDocIdspublic java.util.List<java.lang.String> getDocIds(java.lang.String id) - Specified by:
- getDocIdsin class- AbstractResponse
 
 
- 
 
-