There are 5 types of text fields, ATOM, TEXT, HTML, UNTOKENIZED_PREFIX, and TOKENIZED_PREFIX.
Atom fields when queried, are checked for equality. For example, if you add a field with name
code and an ATOM value of "928A 33B-1", then query code:"928A 33B-1" would match
the document with this field, while query code:928A would not. TEXT fields, unlike ATOM,
match both on equality or if any token extracted from the original field matches. Thus if
code field had the value set with Field.Builder#setText(String) method, both
queries would match. HTML fields have HTML tags stripped before tokenization. Untokenized prefix
fields match queries that are prefixes containing the contiguous starting characters of the whole
field. For example if the field was "the quick brown fox", the query "the qui" would match
whereas "th qui" would not. On the other hand, Tokenized prefix fields match if the query terms
are prefixes of individual terms in the field. If the query is a phrase of terms, the ordering of
the terms will matter. For example if the field is "the quick brown fox", the query "th qui bro"
would match whereas "bro qui the" would not. Vector fields are only used to compute the dot
product between a given constant vector and the provided vector field for sorting and field
expressions only. for example, if a 3d vector is named "scores" and has a value of (1,2,3) then
the expression dot(scores, vector(3,2,1)) will be evaluated to 10.
[[["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\u003eThe \u003ccode\u003eField\u003c/code\u003e class represents a field within a \u003ccode\u003eDocument\u003c/code\u003e, characterized by a name, optional locale, and a single value of various types including text, HTML, atom, date, GeoPoint, untokenized prefix, tokenized prefix, or vector.\u003c/p\u003e\n"],["\u003cp\u003eField names must be between 1 and a specified maximum number of characters, and text, HTML, atom, and both prefix type values have specific length limitations, including vector fields that have a size restriction, while dates must not contain a time component.\u003c/p\u003e\n"],["\u003cp\u003eThere are five types of text fields, ATOM, TEXT, HTML, UNTOKENIZED_PREFIX, and TOKENIZED_PREFIX, each with different matching behaviors when queried; for instance, ATOM fields match on equality, while TEXT fields match on equality or if any token from the field matches.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eField\u003c/code\u003e class includes methods to retrieve the value of the field based on its type, such as \u003ccode\u003egetAtom()\u003c/code\u003e, \u003ccode\u003egetDate()\u003c/code\u003e, \u003ccode\u003egetHTML()\u003c/code\u003e, \u003ccode\u003egetText()\u003c/code\u003e, \u003ccode\u003egetVector()\u003c/code\u003e, as well as its name, locale, and type, and it also allows for creation of new fields through the \u003ccode\u003enewBuilder()\u003c/code\u003e static method.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements methods such as \u003ccode\u003eequals\u003c/code\u003e, \u003ccode\u003ehashCode\u003c/code\u003e, \u003ccode\u003etoString\u003c/code\u003e inherited from the Object class, also available for use.\u003c/p\u003e\n"]]],[],null,["# Class Field (2.0.0)\n\n public final class Field implements Serializable\n\nRepresents a field of a [Document](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.Document), which is a name, an optional locale, and at most one\nvalue: text, HTML, atom, date, GeoPoint, untokenizedPrefix, tokenizedPrefix or vector. Field name\nlengths are between 1 and\n[com.google.appengine.api.search.checkers.SearchApiLimits#MAXIMUM_NAME_LENGTH](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_MAXIMUM_NAME_LENGTH) characters,\nand text and HTML values are limited to\n[com.google.appengine.api.search.checkers.SearchApiLimits#MAXIMUM_TEXT_LENGTH](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_MAXIMUM_TEXT_LENGTH). Atoms are\nlimited to [com.google.appengine.api.search.checkers.SearchApiLimits#MAXIMUM_ATOM_LENGTH](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_MAXIMUM_ATOM_LENGTH)\ncharacters, both prefix types are limited to\n[com.google.appengine.api.search.checkers.SearchApiLimits#MAXIMUM_PREFIX_LENGTH](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_MAXIMUM_PREFIX_LENGTH)\n. Vector field size is limited to\n[com.google.appengine.api.search.checkers.SearchApiLimits#VECTOR_FIELD_MAX_SIZE](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_VECTOR_FIELD_MAX_SIZE)\nand dates must not have a time component.\n\n\nThere are 5 types of text fields, ATOM, TEXT, HTML, UNTOKENIZED_PREFIX, and TOKENIZED_PREFIX.\nAtom fields when queried, are checked for equality. For example, if you add a field with name\n`code` and an ATOM value of \"928A 33B-1\", then query `code:\"928A 33B-1\"` would match\nthe document with this field, while query `code:928A` would not. TEXT fields, unlike ATOM,\nmatch both on equality or if any token extracted from the original field matches. Thus if\n`code` field had the value set with [Field.Builder#setText(String)](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.Field.Builder#com_google_appengine_api_search_Field_Builder_setText_java_lang_String_) method, both\nqueries would match. HTML fields have HTML tags stripped before tokenization. Untokenized prefix\nfields match queries that are prefixes containing the contiguous starting characters of the whole\nfield. For example if the field was \"the quick brown fox\", the query \"the qui\" would match\nwhereas \"th qui\" would not. On the other hand, Tokenized prefix fields match if the query terms\nare prefixes of individual terms in the field. If the query is a phrase of terms, the ordering of\nthe terms will matter. For example if the field is \"the quick brown fox\", the query \"th qui bro\"\nwould match whereas \"bro qui the\" would not. Vector fields are only used to compute the dot\nproduct between a given constant vector and the provided vector field for sorting and field\nexpressions only. for example, if a 3d vector is named \"scores\" and has a value of (1,2,3) then\nthe expression `dot(scores, vector(3,2,1))` will be evaluated to 10. \n\nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e Field \n\nImplements\n----------\n\n[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html) \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 Field.Builder newBuilder()\n\nCreates a field builder.\n\nMethods\n-------\n\n### equals(Object object)\n\n public boolean equals(Object object)\n\n**Overrides** \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)\n\n### getAtom()\n\n public String getAtom()\n\n### getDate()\n\n public Date getDate()\n\n### getGeoPoint()\n\n public GeoPoint getGeoPoint()\n\n### getHTML()\n\n public String getHTML()\n\n### getLocale()\n\n public Locale getLocale()\n\n### getName()\n\n public String getName()\n\n### getNumber()\n\n public Double getNumber()\n\n### getText()\n\n public String getText()\n\n### getTokenizedPrefix()\n\n public String getTokenizedPrefix()\n\n### getType()\n\n public Field.FieldType getType()\n\n### getUntokenizedPrefix()\n\n public String getUntokenizedPrefix()\n\n### getVector()\n\n public List\u003cDouble\u003e getVector()\n\n### hashCode()\n\n public int hashCode()\n\n**Overrides** \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)\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--)"]]