Class Facet (2.0.0)

public final class Facet implements Serializable

A Facet can be used to categorize a Document. It is not a Field.

Search results can contain facets for the extended result set and their value frequency. For example, if a search query is related to "wine", then facets could be "color" with values of "red" and "white", and "year" with values of "2000" and "2005".

Each facet has a name and exactly one value: atom or number. Facet name lengths are between 1 and com.google.appengine.api.search.checkers.SearchApiLimits#MAXIMUM_NAME_LENGTH characters, and atoms are limited to com.google.appengine.api.search.checkers.SearchApiLimits#MAXIMUM_ATOM_LENGTH characters. Numbers must be between com.google.appengine.api.search.checkers.SearchApiLimits#MINIMUM_NUMBER_VALUE and com.google.appengine.api.search.checkers.SearchApiLimits#MAXIMUM_NUMBER_VALUE.

Inheritance

Object > Facet

Implements

Serializable

Static Methods

withAtom(String name, String value)

public static Facet withAtom(String name, String value)

Creates and returns an atom facet with the given name and value.

Parameters
Name Description
name String
value String
Returns
Type Description
Facet

an instance of Facet.

withNumber(String name, Double value)

public static Facet withNumber(String name, Double value)

Creates and returns a number facet with the given name and value.

Parameters
Name Description
name String
value Double
Returns
Type Description
Facet

an instance of Facet.

Methods

equals(Object object)

public boolean equals(Object object)
Parameter
Name Description
object Object
Returns
Type Description
boolean
Overrides

getAtom()

public String getAtom()

Returns the atomic value of the facet. Returns null if the value is not atomic.

Returns
Type Description
String

getName()

public String getName()

Returns the name of the facet.

Returns
Type Description
String

getNumber()

public Double getNumber()

Returns the numeric value of the facet. Returns null if the value is not numeric.

Returns
Type Description
Double

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

toString()

public String toString()
Returns
Type Description
String
Overrides