Class QueryResponseList

java.lang.Object
org.codelibs.fess.util.QueryResponseList
All Implemented Interfaces:
Iterable<Map<String,Object>>, Collection<Map<String,Object>>, List<Map<String,Object>>, SequencedCollection<Map<String,Object>>

public class QueryResponseList extends Object implements List<Map<String,Object>>
A response list that extends List functionality and includes pagination and search metadata. This class wraps search results with pagination information, facet responses, and query statistics. It implements the List interface to provide standard list operations while adding search-specific functionality such as page navigation, record counts, and query execution times.
  • Field Details

    • parent

      protected final List<Map<String,Object>> parent
      The underlying list that contains the actual search result documents.
    • start

      protected final int start
      The starting position of the current page in the overall result set.
    • offset

      protected final int offset
      The offset value used for pagination calculations.
    • pageSize

      protected final int pageSize
      The number of records per page.
    • currentPageNumber

      protected int currentPageNumber
      The current page number (1-based).
    • allRecordCount

      protected long allRecordCount
      The total number of records in the search result set.
    • allRecordCountRelation

      protected String allRecordCountRelation
      The relation type for the total record count (e.g., "eq", "gte").
    • allPageCount

      protected int allPageCount
      The total number of pages based on the page size and total record count.
    • existNextPage

      protected boolean existNextPage
      Flag indicating whether there is a next page available.
    • existPrevPage

      protected boolean existPrevPage
      Flag indicating whether there is a previous page available.
    • currentStartRecordNumber

      protected long currentStartRecordNumber
      The record number of the first record on the current page (1-based).
    • currentEndRecordNumber

      protected long currentEndRecordNumber
      The record number of the last record on the current page (1-based).
    • pageNumberList

      protected List<String> pageNumberList
      A list of page numbers for pagination display (typically a range around the current page).
    • searchQuery

      protected String searchQuery
      The search query string that was used to generate these results.
    • execTime

      protected long execTime
      The total execution time for the search request in milliseconds.
    • facetResponse

      protected FacetResponse facetResponse
      The facet response containing aggregated search facets and their counts.
    • partialResults

      protected boolean partialResults
      Flag indicating whether the search results are partial (not complete).
    • queryTime

      protected long queryTime
      The time taken to execute the search query in milliseconds.
  • Constructor Details

    • QueryResponseList

      protected QueryResponseList(List<Map<String,Object>> documentList, int start, int pageSize, int offset)
      Constructor for testing purposes. Creates a QueryResponseList with minimal pagination information.
      Parameters:
      documentList - the list of documents to wrap
      start - the starting position of the current page
      pageSize - the number of records per page
      offset - the offset value for pagination
    • QueryResponseList

      public QueryResponseList(List<Map<String,Object>> documentList, long allRecordCount, String allRecordCountRelation, long queryTime, boolean partialResults, FacetResponse facetResponse, int start, int pageSize, int offset)
      Main constructor that creates a QueryResponseList with complete search metadata.
      Parameters:
      documentList - the list of documents returned by the search
      allRecordCount - the total number of records in the search result set
      allRecordCountRelation - the relation type for the total record count
      queryTime - the time taken to execute the search query in milliseconds
      partialResults - flag indicating whether the results are partial
      facetResponse - the facet response containing aggregated search facets
      start - the starting position of the current page
      pageSize - the number of records per page
      offset - the offset value for pagination
  • Method Details