Class FacetRequest


  • public final class FacetRequest
    extends Object
    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
     
    • Method Detail

      • newBuilder

        public static FacetRequest.Builder newBuilder​(FacetRequest request)
        Creates a builder from the given FacetRequest.
        Parameters:
        request - the facet request for the builder to use to build another request.
        Returns:
        a new builder with values set from the given request
      • getName

        public String getName()
        Returns the name of the face in this request.
      • getValueLimit

        public Integer getValueLimit()
        Returns the maximum number of values this facet should have. Null if the value limit is not set.
      • getValueConstraints

        public List<String> getValueConstraints()
        Returns an unmodifiable list of value constraints.