|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface SearchableMetaData
Sepcifies additional meta-data on a SearchableProperty or
SearchableId.
SearchableId and SearchableProperty can be used to
auto-generate meta-data. If more than one meta-data is required, the
SearchableMetaData/SearchableMetaDatas can be used.
The searchable meta-data is meant to handle basic types (which usually translate to
a String saved in the search engine). The conversion is done using converters, with
Compass providing converters for most basic types. A specialized Converter can be
associated with the auto generated meta-data using converter(). The
specialized converter will implement the Converter
interface, usually extending the AbstractBasicConverter.
Another way of defining a converter for a class can be done using the SearchableClassConverter
to annotate the class that needs conversion, with Compass auto detecting it.
Note, that most of the time, a specialized converter for user classes will not be needed,
since the SearchableComponent usually makes more sense to use.
The searchalbe property can annotate a Collection type field/property,
supporting either List or Set. The searchable property
will try and automatically identify the element type using generics, but if the collection
is not defined with generics, SearchableProperty.type() should be used to hint for
the collection element type.
The searchable property can annotate an array as well, with the array element type used for
Converter lookups.
| Required Element Summary | |
|---|---|
String |
name
The name of the meta-data. |
| Optional Element Summary | |
|---|---|
String |
analyzer
Specifies a specialized analyzer lookup name that will be used to analyze the meta-data content. |
float |
boost
The boost level for the meta-data. |
String |
converter
The converter lookup name for the given meta-data. |
ExcludeFromAll |
excludeFromAll
Specifies if this meta-data should be excluded from the generated "all" meta-data. |
String |
format
The format to apply to the value. |
Index |
index
Specifies whether and how a meta-data proeprty should be indexed. |
String |
nullValue
A null value to use to store in the index when the property has a null
value. |
OmitNorms |
omitNorms
Expert: If set, omit normalization factors associated with this indexed field. |
OmitTf |
omitTf
Expert: If set, omit tf from postings of this indexed field. |
Reverse |
reverse
Specifies whether and how the meta-data proeprty should value will be revered. |
SpellCheck |
spellCheck
Should this propety be included in the spell check index. |
Store |
store
Specifies whether and how a meta-data property will be stored. |
TermVector |
termVector
Specifies whether and how a meta-data property should have term vectors. |
| Element Detail |
|---|
public abstract String name
public abstract float boost
public abstract Store store
public abstract Index index
public abstract TermVector termVector
public abstract OmitNorms omitNorms
public abstract OmitTf omitTf
public abstract Reverse reverse
public abstract String analyzer
public abstract ExcludeFromAll excludeFromAll
SearchableAllMetaData.enable()public abstract String converter
public abstract String format
public abstract String nullValue
null
value. Defaults to not storing null values if the globabl setting of
compass.mapping.nullvalue is not set. If it set, disabling the null
value can be done by setting it to CompassEnvironment.NullValue.DISABLE_NULL_VALUE_FOR_MAPPING
value ($disable$).
public abstract SpellCheck spellCheck
Note, most times this is not requried to be configured, since by default, the spell check index uses the "all" property.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||