public final class Field
extends java.lang.Object
implements java.io.Serializable
Document
, which is a name, an optional locale, and at most one
value: text, HTML, atom, date or GeoPoint. Field name lengths are between 1 and
SearchApiLimits.MAXIMUM_NAME_LENGTH
characters,
and text and HTML values are limited to
SearchApiLimits.MAXIMUM_TEXT_LENGTH
. Atoms as
limited to
SearchApiLimits.MAXIMUM_ATOM_LENGTH
characters, and dates must not have a time component.
There are 3 types of text fields, ATOM, TEXT, and HTML. 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. Finally, HTML fields
have HTML tags stripped before tokenization.
Modifier and Type | Class and Description |
---|---|
static class
|
Field.Builder
A field builder.
|
static class
|
Field.FieldType
The type of the field value.
|
Modifier and Type | Method and Description |
---|---|
boolean
|
equals
(java.lang.Object object)
|
java.lang.String
|
getAtom
()
|
java.util.Date
|
getDate
()
|
GeoPoint
|
getGeoPoint
()
|
java.lang.String
|
getHTML
()
|
java.util.Locale
|
getLocale
()
|
java.lang.String
|
getName
()
|
java.lang.Double
|
getNumber
()
|
java.lang.String
|
getText
()
|
Field.FieldType
|
getType
()
|
int
|
hashCode
()
|
static
Field.Builder
|
newBuilder
()
Creates a field builder.
|
java.lang.String
|
toString
()
|
public java.lang.String getName()
public Field.FieldType getType()
public java.lang.String getText()
public java.lang.String getHTML()
public java.lang.String getAtom()
public java.util.Date getDate()
public java.lang.Double getNumber()
public java.util.Locale getLocale()
public int hashCode()
hashCode
in class
java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class
java.lang.Object
public static Field.Builder newBuilder()
public java.lang.String toString()
toString
in class
java.lang.Object