Class FacetResponse

java.lang.Object
org.codelibs.fess.util.FacetResponse

public class FacetResponse extends Object
Response object for faceted search results containing query counts and field facets. This class processes OpenSearch aggregations to provide structured facet information for search result filtering and navigation.
  • Field Details

    • queryCountMap

      protected Map<String,Long> queryCountMap
      Map containing query facet counts, where keys are decoded query strings and values are document counts for each query.
    • fieldList

      protected List<FacetResponse.Field> fieldList
      List of field facets containing aggregated field values and their counts.
  • Constructor Details

    • FacetResponse

      public FacetResponse(org.opensearch.search.aggregations.Aggregations aggregations)
      Constructs a FacetResponse from OpenSearch aggregations. Processes both field facets and query facets from the aggregation results.
      Parameters:
      aggregations - the OpenSearch aggregations containing facet data, may be null
  • Method Details

    • hasFacetResponse

      public boolean hasFacetResponse()
      Checks if this response contains any facet information.
      Returns:
      true if either query count map or field list is not null
    • getQueryCountMap

      public Map<String,Long> getQueryCountMap()
      Gets the map of query facet counts.
      Returns:
      the queryCountMap containing decoded query strings and their counts
    • getFieldList

      public List<FacetResponse.Field> getFieldList()
      Gets the list of field facets.
      Returns:
      the fieldList containing all field facet information
    • toString

      public String toString()
      Overrides:
      toString in class Object