Stay organized with collections
Save and categorize content based on your preferences.
publicstaticfinalclassFacetRequest.Builder
A facet request builder. Each facet request should at least have the name of the facet.
It can also includes number of values, a list of constraints on the values or a list of ranges
for numeric facets. Note that the list of constraints and the list of ranges are mutually
exclusive, i.e. you can specify one of them but not both.
Adds a FacetRange to this request. Note that ranges and value constraints are
mutually exclusive. Either of them can be provided, but not both for the same request.
Adds a value constraint to this facet request. Note that ranges and value constraints
are mutually exclusive. Either of them can be provided, but not both for the same request.
[[["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-09-03 UTC."],[[["\u003cp\u003e\u003ccode\u003eFacetRequest.Builder\u003c/code\u003e is used to create a facet request, which must include at least the facet's \u003ccode\u003ename\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can set the number of values to return for a facet using \u003ccode\u003esetValueLimit\u003c/code\u003e and add specific ranges or constraints to the facet.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eaddRange\u003c/code\u003e and \u003ccode\u003eaddValueConstraint\u003c/code\u003e are mutually exclusive; you can use one or the other but not both for the same request.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild\u003c/code\u003e method finalizes the facet request, returning a \u003ccode\u003eFacetRequest\u003c/code\u003e object with the specified parameters.\u003c/p\u003e\n"]]],[],null,["# Class FacetRequest.Builder (2.0.0)\n\n public static final class FacetRequest.Builder\n\nA facet request builder. Each facet request should at least have the `name` of the facet.\nIt can also includes number of values, a list of constraints on the values or a list of ranges\nfor numeric facets. Note that the list of constraints and the list of ranges are mutually\nexclusive, i.e. you can specify one of them but not both. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e FacetRequest.Builder \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\nMethods\n-------\n\n### addRange(FacetRange range)\n\n public FacetRequest.Builder addRange(FacetRange range)\n\nAdds a [FacetRange](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.FacetRange) to this request. Note that ranges and value constraints are\nmutually exclusive. Either of them can be provided, but not both for the same request.\n\n### addValueConstraint(String constraint)\n\n public FacetRequest.Builder addValueConstraint(String constraint)\n\nAdds a value `constraint` to this facet request. Note that ranges and value constraints\nare mutually exclusive. Either of them can be provided, but not both for the same request.\n\n### build()\n\n public FacetRequest build()\n\nConstruct the final message.\n\n### setName(String name)\n\n public FacetRequest.Builder setName(String name)\n\nSets the name of the facet for this request.\n\n### setValueLimit(int valueLimit)\n\n public FacetRequest.Builder setValueLimit(int valueLimit)\n\nSets the maximum number of values for this facet to return."]]