Package org.opencms.search.solr
Class CmsSolrResultList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<CmsSearchResource>
-
- org.opencms.search.solr.CmsSolrResultList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<CmsSearchResource>
,java.util.Collection<CmsSearchResource>
,java.util.List<CmsSearchResource>
,java.util.RandomAccess
public class CmsSolrResultList extends java.util.ArrayList<CmsSearchResource>
Encapsulates a list of 'OpenCms resource documents' (CmsSearchResource
).This list can be accessed exactly like an
ArrayList
which entries areCmsSearchResource
that extendCmsResource
and holds the Solr implementation ofI_CmsSearchDocument
as member. This enables you to deal with the resulting list as you do with well knownList
and work on it's entries like you do onCmsResource
.- Since:
- 8.5.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CmsSolrResultList(org.apache.solr.client.solrj.SolrQuery query, org.apache.solr.client.solrj.response.QueryResponse queryResponse, org.apache.solr.common.SolrDocumentList resultDocuments, java.util.List<CmsSearchResource> resourceDocumentList, int start, java.lang.Integer rows, int end, int page, long visibleHitCount, java.lang.Float maxScore, long startTime, long highlightEndTime)
The public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getEnd()
Returns the last index of documents to display.org.apache.solr.client.solrj.response.FacetField
getFacetDate(java.lang.String name)
Delegator.java.util.List<org.apache.solr.client.solrj.response.FacetField>
getFacetDates()
Delegator.org.apache.solr.client.solrj.response.FacetField
getFacetField(java.lang.String name)
Delegator.java.util.List<org.apache.solr.client.solrj.response.FacetField>
getFacetFields()
Delegator.java.util.Map<java.lang.String,java.lang.Integer>
getFacetQuery()
Delegator.java.util.List<org.apache.solr.client.solrj.response.RangeFacet>
getFacetRanges()
Delegator.long
getHighlightEndTime()
Returns the time in ms when the highlighting is finished.java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<java.lang.String>>>
getHighLighting()
Returns the highlighting information.java.util.List<org.apache.solr.client.solrj.response.FacetField>
getLimitingFacets()
Delegator.java.lang.Float
getMaxScore()
Returns the score of the best matching document.long
getNumFound()
Returns the count of docs that have been found.int
getPage()
Returns the current page.org.apache.solr.client.solrj.SolrQuery
getQuery()
The original Solr query.java.lang.Integer
getRows()
Returns the requested row count.org.apache.solr.client.solrj.response.SpellCheckResponse
getSpellCheckResponse()
Delegator.java.lang.Long
getStart()
Returns the start index (offset).long
getStartTime()
Returns the start time.long
getVisibleHitCount()
Returns the visible hit count.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Constructor Detail
-
CmsSolrResultList
public CmsSolrResultList(org.apache.solr.client.solrj.SolrQuery query, org.apache.solr.client.solrj.response.QueryResponse queryResponse, org.apache.solr.common.SolrDocumentList resultDocuments, java.util.List<CmsSearchResource> resourceDocumentList, int start, java.lang.Integer rows, int end, int page, long visibleHitCount, java.lang.Float maxScore, long startTime, long highlightEndTime)
The public constructor.- Parameters:
query
- original Solr queryqueryResponse
- original query responseresultDocuments
- original list of Solr documentsresourceDocumentList
- the list of resource documentsstart
- the start (offset)rows
- the rows (hits per page)end
- the end (start + rows)page
- the current page (start / rows)visibleHitCount
- the visible hit countmaxScore
- the max score of the best matching docstartTime
- the start time when the query has been executedhighlightEndTime
- the time in ms when the highlighting is finished
-
-
Method Detail
-
getEnd
public int getEnd()
Returns the last index of documents to display.- Returns:
- the last index of documents to display
-
getFacetDate
public org.apache.solr.client.solrj.response.FacetField getFacetDate(java.lang.String name)
Delegator.- Parameters:
name
- the name- Returns:
- the facet field
-
getFacetDates
public java.util.List<org.apache.solr.client.solrj.response.FacetField> getFacetDates()
Delegator.- Returns:
- the list of faceted date fields
-
getFacetField
public org.apache.solr.client.solrj.response.FacetField getFacetField(java.lang.String name)
Delegator.- Parameters:
name
- the name- Returns:
- the facet field
-
getFacetFields
public java.util.List<org.apache.solr.client.solrj.response.FacetField> getFacetFields()
Delegator.- Returns:
- the list of faceted fields
-
getFacetQuery
public java.util.Map<java.lang.String,java.lang.Integer> getFacetQuery()
Delegator.- Returns:
- the facet query
-
getFacetRanges
public java.util.List<org.apache.solr.client.solrj.response.RangeFacet> getFacetRanges()
Delegator.- Returns:
- the list of facet ranges
-
getHighlightEndTime
public long getHighlightEndTime()
Returns the time in ms when the highlighting is finished.- Returns:
- the time in ms when the highlighting is finished
-
getHighLighting
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<java.lang.String>>> getHighLighting()
Returns the highlighting information.- Returns:
- the highlighting information
-
getLimitingFacets
public java.util.List<org.apache.solr.client.solrj.response.FacetField> getLimitingFacets()
Delegator.- Returns:
- the limiting facets
-
getMaxScore
public java.lang.Float getMaxScore()
Returns the score of the best matching document.- Returns:
- the score of the best matching document
-
getNumFound
public long getNumFound()
Returns the count of docs that have been found.- Returns:
- the count of docs that have been found
-
getPage
public int getPage()
Returns the current page.- Returns:
- the current page
-
getQuery
public org.apache.solr.client.solrj.SolrQuery getQuery()
The original Solr query.- Returns:
- the query
-
getRows
public java.lang.Integer getRows()
Returns the requested row count.- Returns:
- the rows
-
getSpellCheckResponse
public org.apache.solr.client.solrj.response.SpellCheckResponse getSpellCheckResponse()
Delegator.- Returns:
- the spellcheck response
-
getStart
public java.lang.Long getStart()
Returns the start index (offset).- Returns:
- the start
-
getStartTime
public long getStartTime()
Returns the start time.- Returns:
- the start time
-
getVisibleHitCount
public long getVisibleHitCount()
Returns the visible hit count.- Returns:
- the visible count of documents
-
-