Package org.ametys.cms.search.solr
Class SolrSearchResults<A extends AmetysObject>
- java.lang.Object
 - 
- org.ametys.cms.search.solr.SolrSearchResults<A>
 
 
- 
- Type Parameters:
 A- the actual type ofAmetysObjects.
- All Implemented Interfaces:
 SearchResults<A>
public class SolrSearchResults<A extends AmetysObject> extends Object implements SearchResults<A>
Solr implementation of aSearchResults. 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected org.apache.solr.common.SolrDocumentList_docListThe Solr documents of the search responseprotected Map<String,Map<String,Integer>>_facetResultsThe facet results.protected AmetysObjectResolver_resolverThe AmetysObject resolver.protected org.apache.solr.client.solrj.response.QueryResponse_responseThe solr query response 
- 
Constructor Summary
Constructors Constructor Description SolrSearchResults(org.apache.solr.client.solrj.response.QueryResponse response, AmetysObjectResolver resolver, Map<String,Map<String,Integer>> facetResults)Build a SolrSearchResults object. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Map<String,Object>>getDebugMap()Gets the response debug map if availableMap<String,Map<String,Integer>>getFacetResults()Get the facet results as a Map, indexed by faceted criterion ID.
The Map values are represented by a Map of value -> result count.floatgetMaxScore()Get the maximum score of all the results.Iterable<String>getObjectIds()Get the result IDs.AmetysObjectIterable<A>getObjects()Get theAmetysObjectresultsSearchResultsIterable<SearchResult<A>>getResults()Get theIterableof the search results.longgetTotalCount()Get the total number of search results. 
 - 
 
- 
- 
Field Detail
- 
_response
protected org.apache.solr.client.solrj.response.QueryResponse _response
The solr query response 
- 
_docList
protected org.apache.solr.common.SolrDocumentList _docList
The Solr documents of the search response 
- 
_resolver
protected AmetysObjectResolver _resolver
The AmetysObject resolver. 
 - 
 
- 
Constructor Detail
- 
SolrSearchResults
public SolrSearchResults(org.apache.solr.client.solrj.response.QueryResponse response, AmetysObjectResolver resolver, Map<String,Map<String,Integer>> facetResults)
Build a SolrSearchResults object.- Parameters:
 response- the solr search response.resolver- The Ametys object resolver.facetResults- The facet results.
 
 - 
 
- 
Method Detail
- 
getResults
public SearchResultsIterable<SearchResult<A>> getResults()
Description copied from interface:SearchResultsGet theIterableof the search results.- Specified by:
 getResultsin interfaceSearchResults<A extends AmetysObject>- Returns:
 - A 
SearchResultsIterableon theSearchResult. 
 
- 
getObjects
public AmetysObjectIterable<A> getObjects()
Description copied from interface:SearchResultsGet theAmetysObjectresults- Specified by:
 getObjectsin interfaceSearchResults<A extends AmetysObject>- Returns:
 - An 
AmetysObjectIterableon the results. 
 
- 
getObjectIds
public Iterable<String> getObjectIds()
Description copied from interface:SearchResultsGet the result IDs.- Specified by:
 getObjectIdsin interfaceSearchResults<A extends AmetysObject>- Returns:
 - An 
Iterableon the content IDs. 
 
- 
getFacetResults
public Map<String,Map<String,Integer>> getFacetResults()
Description copied from interface:SearchResultsGet the facet results as a Map, indexed by faceted criterion ID.
The Map values are represented by a Map of value -> result count.- Specified by:
 getFacetResultsin interfaceSearchResults<A extends AmetysObject>- Returns:
 - the facet results.
 
 
- 
getTotalCount
public long getTotalCount()
Description copied from interface:SearchResultsGet the total number of search results.- Specified by:
 getTotalCountin interfaceSearchResults<A extends AmetysObject>- Returns:
 - the total number of results matching the search (whatever the limit): the iterable may contain less objects than this count.
 
 
- 
getMaxScore
public float getMaxScore()
Description copied from interface:SearchResultsGet the maximum score of all the results.- Specified by:
 getMaxScorein interfaceSearchResults<A extends AmetysObject>- Returns:
 - the maximum score of all the results.
 
 
- 
getDebugMap
public Optional<Map<String,Object>> getDebugMap()
Description copied from interface:SearchResultsGets the response debug map if available- Specified by:
 getDebugMapin interfaceSearchResults<A extends AmetysObject>- Returns:
 - the response debug map if available
 
 
 - 
 
 -