org.apache.solr.search

Interface DocList

  • All Superinterfaces:
    Accountable, AutoCloseable, Closeable, DocSet
    All Known Implementing Classes:
    DocSlice


    public interface DocList
    extends DocSet
    DocList represents the result of a query: an ordered list of document ids with optional score. This list contains a subset of the complete list of documents actually matched: size() document ids starting at offset().
    Since:
    solr 0.9
    • Method Detail

      • offset

        int offset()
        Returns the zero based offset of this list within the total ordered list of matches to the query.
      • size

        int size()
        Returns the number of ids in this list.
        Specified by:
        size in interface DocSet
      • matches

        int matches()
        Returns the total number of matches for the search (as opposed to just the number collected according to offset() and size()). Hence it's always true that matches() >= size()
        Returns:
        number of matches for the search(query & any filters)
      • subset

        DocList subset(int offset,
                       int len)
        Get a subset of an existing DocList. Returns null if not possible.
      • iterator

        DocIterator iterator()
        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 DocSet
        See Also:
        hasScores()
      • hasScores

        boolean hasScores()
        True if scores were retained
      • maxScore

        float maxScore()
        The maximum score for the search... only valid if scores were retained (if hasScores()==true)