FacetResult Class

  • java.lang.Object
    • com.azure.search.documents.models.FacetResult

Implements

public final class FacetResult
implements 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

Constructor Description
FacetResult()

Creates an instance of FacetResult class.

Method Summary

Modifier and Type Method and Description
static FacetResult fromJson(JsonReader jsonReader)

Reads an instance of FacetResult from the JsonReader.

Map<String,Object> getAdditionalProperties()

Get the additionalProperties property: A single bucket of a facet query result.

Double getAvg()

Get the avg property: The resulting total avg for the facet when a avg metric is requested.

Long getCardinality()

Get the cardinality property: The resulting total cardinality for the facet when a cardinality metric is requested.

Long getCount()

Get the count property: The approximate count of documents falling within the bucket described by this facet.

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.

Double getMax()

Get the max property: The resulting total max for the facet when a max metric is requested.

Double getMin()

Get the min property: The resulting total min for the facet when a min metric is requested.

Double getSum()

Get the sum property: The resulting total sum for the facet when a sum metric is requested.

FacetResult setAdditionalProperties(Map<String,Object> additionalProperties)

Set the additionalProperties property: A single bucket of a facet query result.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

FacetResult

public FacetResult()

Creates an instance of FacetResult class.

Method Details

fromJson

public static FacetResult fromJson(JsonReader jsonReader)

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.

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.

getAvg

public Double getAvg()

Get the avg property: The resulting total avg for the facet when a avg metric is requested.

Returns:

the avg value.

getCardinality

public Long getCardinality()

Get the cardinality property: The resulting total cardinality for the facet when a cardinality metric is requested.

Returns:

the cardinality value.

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.

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.

getMax

public Double getMax()

Get the max property: The resulting total max for the facet when a max metric is requested.

Returns:

the max value.

getMin

public Double getMin()

Get the min property: The resulting total min for the facet when a min metric is requested.

Returns:

the min 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.

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 JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to