Class TopDocsSlice

java.lang.Object
org.apache.solr.search.DocSlice
org.apache.solr.search.TopDocsSlice
All Implemented Interfaces:
org.apache.lucene.util.Accountable, DocList

public class TopDocsSlice extends DocSlice
TopDocsSlice implements DocList based off provided TopDocs.
Since:
solr 9.9
  • Constructor Details

    • TopDocsSlice

      public TopDocsSlice(int offset, int len, org.apache.lucene.search.TopDocs topDocs, long matches, boolean hasScores, float maxScore, org.apache.lucene.search.TotalHits.Relation matchesRelation)
      Construct a slice off topDocs
      Parameters:
      offset - starting offset for this range of docs
      len - length of results
      matches - total number of matches for the query
  • Method Details

    • subset

      public TopDocsSlice subset(int offset, int len)
      Description copied from interface: DocList
      Get a subset of an existing DocList. Returns null if not possible.
      Specified by:
      subset in interface DocList
      Overrides:
      subset in class DocSlice
    • hasScores

      public boolean hasScores()
      Description copied from interface: DocList
      True if scores were retained
      Specified by:
      hasScores in interface DocList
      Overrides:
      hasScores in class DocSlice
    • iterator

      public DocIterator iterator()
      Description copied from interface: DocList
      Returns an iterator that may be used to iterate over the documents in this DocList

      The order of the documents returned by this iterator is based on the Sort order of the search that produced it. The Scoring information is meaningful only if hasScores() returns true.

      Specified by:
      iterator in interface DocList
      Overrides:
      iterator in class DocSlice
      See Also: