Creates and returns a FacetRequest builder. Set the facet request parameters and use
the Builder#build() method to create a concrete instance of FacetRequest.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003e\u003ccode\u003eFacetRequest\u003c/code\u003e is a class used to define the parameters for requesting specific facets within a query result.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a \u003ccode\u003eFacetRequest\u003c/code\u003e to specify constraints on facet values, such as requesting only "white" and "red" for a "wine_type" facet.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFacetRequest\u003c/code\u003e also allows defining ranges for a facet, like requesting values within or outside of certain year ranges.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003enewBuilder()\u003c/code\u003e method creates a \u003ccode\u003eFacetRequest.Builder\u003c/code\u003e to configure the facet request parameters, and the \u003ccode\u003enewBuilder(FacetRequest request)\u003c/code\u003e method allows building a new request based on an existing one.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods to get the name of the facet, its ranges using \u003ccode\u003egetRanges()\u003c/code\u003e, its value constraints using \u003ccode\u003egetValueConstraints()\u003c/code\u003e, or the value limit using \u003ccode\u003egetValueLimit()\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class FacetRequest (2.0.0)\n\n public final class FacetRequest\n\nA facet request representing parameters for requesting specific facets to be returned with a\nquery result.\n\nFor example, to request a facet with a name and specific values: \n\n\n FacetRequest request = FacetRequest.newBuilder().setName(\"wine_type\")\n .addValueConstraint(\"white\").addValueConstraint(\"red\").build();\n \nand to request ranges: \n\n\n FacetRequest request = FacetRequest.newBuilder().setName(\"year\")\n .addRange(null, 2000.0) // year \u003c 2000.0=\"\" .addrange(1980.0,=\"\" 2000.0)=\"\" 1980.0=\"\"\u003e\u003c= year=\"\"\u003e\u003c 2000.0=\"\" .addrange(2000.0,=\"\" null).build();=\"\" year=\"\"\u003e= 2000.0\n \nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e FacetRequest \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### newBuilder()\n\n public static FacetRequest.Builder newBuilder()\n\nCreates and returns a [FacetRequest](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.FacetRequest) builder. Set the facet request parameters and use\nthe Builder#build() method to create a concrete instance of FacetRequest.\n\n### newBuilder(FacetRequest request)\n\n public static FacetRequest.Builder newBuilder(FacetRequest request)\n\nCreates a builder from the given FacetRequest.\n\nMethods\n-------\n\n### getName()\n\n public String getName()\n\nReturns the name of the face in this request.\n\n### getRanges()\n\n public List\u003cFacetRange\u003e getRanges()\n\nReturns an unmodifiable list of [FacetRange](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.FacetRange)s.\n\n### getValueConstraints()\n\n public List\u003cString\u003e getValueConstraints()\n\nReturns an unmodifiable list of value constraints.\n\n### getValueLimit()\n\n public Integer getValueLimit()\n\nReturns the maximum number of values this facet should have. Null if the value limit is not\nset.\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)"]]