Class FacetRequest (2.0.0)

public final class FacetRequest

A facet request representing parameters for requesting specific facets to be returned with a query result.

For example, to request a facet with a name and specific values:


   FacetRequest request = FacetRequest.newBuilder().setName("wine_type")
       .addValueConstraint("white").addValueConstraint("red").build();
  

and to request ranges:


 FacetRequest request = FacetRequest.newBuilder().setName("year")
     .addRange(null, 2000.0)           // year < 2000.0="" .addrange(1980.0,="" 2000.0)="" 1980.0=""><= year="">< 2000.0="" .addrange(2000.0,="" null).build();="" year="">= 2000.0
 

Inheritance

java.lang.Object > FacetRequest

Static Methods

newBuilder()

public static FacetRequest.Builder newBuilder()

Creates and returns a FacetRequest builder. Set the facet request parameters and use the Builder#build() method to create a concrete instance of FacetRequest.

Returns
Type Description
FacetRequest.Builder

a Builder which can construct a facet request

newBuilder(FacetRequest request)

public static FacetRequest.Builder newBuilder(FacetRequest request)

Creates a builder from the given FacetRequest.

Parameter
Name Description
request FacetRequest

the facet request for the builder to use to build another request.

Returns
Type Description
FacetRequest.Builder

a new builder with values set from the given request

Methods

getName()

public String getName()

Returns the name of the face in this request.

Returns
Type Description
String

getRanges()

public List<FacetRange> getRanges()

Returns an unmodifiable list of FacetRanges.

Returns
Type Description
List<FacetRange>

getValueConstraints()

public List<String> getValueConstraints()

Returns an unmodifiable list of value constraints.

Returns
Type Description
List<String>

getValueLimit()

public Integer getValueLimit()

Returns the maximum number of values this facet should have. Null if the value limit is not set.

Returns
Type Description
Integer

toString()

public String toString()
Returns
Type Description
String
Overrides