FacetRequest (Google App Engine API for Java)

com.google.appengine.api.search

Class FacetRequest

  • java.lang.Object
    • com.google.appengine.api.search.FacetRequest


  • public final class FacetRequest
    extends java.lang.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 java.lang.String getName()
        Returns the name of the face in this request.
      • getValueLimit

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

        public java.util.List<FacetRange> getRanges()
        Returns an unmodifiable list of FacetRanges.
      • getValueConstraints

        public java.util.List<java.lang.String> getValueConstraints()
        Returns an unmodifiable list of value constraints.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object