[[["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-28 UTC."],[[["\u003cp\u003e\u003ccode\u003eField.Builder\u003c/code\u003e is used to construct \u003ccode\u003eField\u003c/code\u003e objects, which must include a name and can optionally include a locale.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eField\u003c/code\u003e can hold at most one of the following data types: text, HTML, atom, or date.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild()\u003c/code\u003e method finalizes the construction of a \u003ccode\u003eField\u003c/code\u003e object, ensuring it has a valid name, string value, and type.\u003c/p\u003e\n"],["\u003cp\u003eVarious setter methods are available to assign specific values to a \u003ccode\u003eField\u003c/code\u003e, such as \u003ccode\u003esetAtom\u003c/code\u003e, \u003ccode\u003esetDate\u003c/code\u003e, \u003ccode\u003esetHTML\u003c/code\u003e, \u003ccode\u003esetText\u003c/code\u003e, and \u003ccode\u003esetNumber\u003c/code\u003e, \u003ccode\u003esetGeoPoint\u003c/code\u003e, \u003ccode\u003esetVector\u003c/code\u003e, \u003ccode\u003esetTokenizedPrefix\u003c/code\u003e and \u003ccode\u003esetUntokenizedPrefix\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe setter \u003ccode\u003esetName\u003c/code\u003e is used to set the name of the field, and \u003ccode\u003esetLocale\u003c/code\u003e is used to set the locale of the field value.\u003c/p\u003e\n"]]],[],null,["# Class Field.Builder (2.0.0)\n\n public static final class Field.Builder\n\nA field builder. Fields must have a name, and optionally a locale\nand at most one of text, html, atom or date. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e Field.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### build()\n\n public Field build()\n\nBuilds a field using this builder. The field must have a\nvalid name, string value, type.\n\n### setAtom(String atom)\n\n public Field.Builder setAtom(String atom)\n\nSets an atomic value, indivisible text, for the field.\n\n### setDate(Date date)\n\n public Field.Builder setDate(Date date)\n\nSets a date associated with the field.\n\n### setGeoPoint(GeoPoint geoPoint)\n\n public Field.Builder setGeoPoint(GeoPoint geoPoint)\n\nSets a [GeoPoint](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.GeoPoint) value for the field.\n\n### setHTML(String html)\n\n public Field.Builder setHTML(String html)\n\nSets a HTML value for the field.\n\n### setLocale(Locale locale)\n\n public Field.Builder setLocale(Locale locale)\n\nSets the Locale of the field value. If none is given, then the locale\nof the document will be used.\n\n### setName(String name)\n\n public Field.Builder setName(String name)\n\nSets a name for the field. The field name length must be\nbetween 1 and FieldChecker#MAXIMUM_NAME_LENGTH and it should match\n[com.google.appengine.api.search.checkers.SearchApiLimits#FIELD_NAME_PATTERN](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_FIELD_NAME_PATTERN).\n\n### setNumber(double number)\n\n public Field.Builder setNumber(double number)\n\nSets a numeric value for the field. The `number` must be between\n[com.google.appengine.api.search.checkers.SearchApiLimits#MINIMUM_NUMBER_VALUE](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_MINIMUM_NUMBER_VALUE) and\n[com.google.appengine.api.search.checkers.SearchApiLimits#MAXIMUM_NUMBER_VALUE](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_MAXIMUM_NUMBER_VALUE).\n\n### setText(String text)\n\n public Field.Builder setText(String text)\n\nSets a text value for the field.\n\n### setTokenizedPrefix(String tokenizedPrefix)\n\n public Field.Builder setTokenizedPrefix(String tokenizedPrefix)\n\nSets a tokenized prefix value for the field.\n\n### setUntokenizedPrefix(String untokenizedPrefix)\n\n public Field.Builder setUntokenizedPrefix(String untokenizedPrefix)\n\nSets an untokenized prefix value for the field.\n\n### setVector(List\\\u003cDouble\\\u003e vector)\n\n public Field.Builder setVector(List\u003cDouble\u003e vector)\n\nSets a vector value for the field."]]