Class FacetResult

java.lang.Object
com.azure.search.documents.models.FacetResult
All Implemented Interfaces:
com.azure.json.JsonSerializable<FacetResult>

public final class FacetResult extends Object implements com.azure.json.JsonSerializable<FacetResult>
A single bucket of a facet query result. Reports the number of documents with a field value falling within a particular range or having a particular value or interval.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of FacetResult class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of FacetResult from the JsonReader.
    Get the additionalProperties property: A single bucket of a facet query result.
    Get the count property: The approximate count of documents falling within the bucket described by this facet.
    Get the facets property: The nested facet query results for the search operation, organized as a collection of buckets for each faceted field; null if the query did not contain any nested facets.
    Get the sum property: The resulting total sum for the facet when a sum metric is requested.
    setAdditionalProperties(Map<String,Object> additionalProperties)
    Set the additionalProperties property: A single bucket of a facet query result.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • FacetResult

      public FacetResult()
      Creates an instance of FacetResult class.
  • Method Details

    • getCount

      public Long getCount()
      Get the count property: The approximate count of documents falling within the bucket described by this facet.
      Returns:
      the count value.
    • getSum

      public Double getSum()
      Get the sum property: The resulting total sum for the facet when a sum metric is requested.
      Returns:
      the sum value.
    • getFacets

      public Map<String,List<FacetResult>> getFacets()
      Get the facets property: The nested facet query results for the search operation, organized as a collection of buckets for each faceted field; null if the query did not contain any nested facets.
      Returns:
      the facets value.
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
      Get the additionalProperties property: A single bucket of a facet query result. Reports the number of documents with a field value falling within a particular range or having a particular value or interval.
      Returns:
      the additionalProperties value.
    • setAdditionalProperties

      public FacetResult setAdditionalProperties(Map<String,Object> additionalProperties)
      Set the additionalProperties property: A single bucket of a facet query result. Reports the number of documents with a field value falling within a particular range or having a particular value or interval.
      Parameters:
      additionalProperties - the additionalProperties value to set.
      Returns:
      the FacetResult object itself.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<FacetResult>
      Throws:
      IOException
    • fromJson

      public static FacetResult fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of FacetResult from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of FacetResult if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the FacetResult.