|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface SearchableProperty
Specifies a searchable property on property or field of the Searchable class.
The searchable property will automatically create a SearchableMetaData,
with its name being the field/property name. It will not be created if the
name() is not set AND there are either SearchableMetaData or
SearchableMetaDatas annotating the class field/property. Most of
the attributes that can control the meta-data are provided in the searchable
property as well, they are marked in the java doc.
The searchable property/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 searchable 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, 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.
Compass might require an internal meta-data to be created, so it can identify the correct
value that match the property/field. Controlling the creation and specifics of the intenal
meta-data id can be done using managedId() and managedIdIndex().
| Optional Element Summary | |
|---|---|
String |
accessor
The property accessor that will be fetch and write the property value. |
String |
analyzer
The analyzer of the auto generated SearchableMetaData. |
float |
boost
The boost of the auto generated SearchableMetaData. |
String |
converter
The converter of the auto generated SearchableMetaData. |
ExcludeFromAll |
excludeFromAll
The exclude from all of the auto generated SearchableMetaData. |
String |
format
The format of the auto generated SearchableMetaData. |
Index |
index
The index of the auto generated SearchableMetaData. |
ManagedId |
managedId
Controls if the internal meta-data id creation. |
ManagedIdIndex |
managedIdIndex
If the internal meta-data id is created, controls it's index parameter. |
String |
name
The name of the auto generated SearchableMetaData. |
String |
nullValue
A null value to use to store in the index when the property has a null
value. |
OmitNorms |
omitNorms
The omitNorms of the auto generated SearchableMetaData. |
OmitTf |
omitTf
The omitTf of the auto generated SearchableMetaData. |
boolean |
override
If there is already an existing id with the same field/property name defined, will override it. |
String |
propertyConverter
Converter that will apply to the property mapping. |
Reverse |
reverse
The reverse of the auto generated SearchableMetaData. |
SpellCheck |
spellCheck
Should this propety be included in the spell check index. |
Store |
store
The store of the auto generated SearchableMetaData. |
TermVector |
termVector
The termVector of the auto generated SearchableMetaData. |
Class |
type
The class type of the property. |
public abstract ManagedId managedId
public abstract ManagedIdIndex managedIdIndex
public abstract Class type
Collection properties, without
specific Generic type parameter.
public abstract boolean override
public abstract String propertyConverter
public abstract String accessor
It is automatically set based on where the annotation is used, but can be explicitly set. Compass also supports custom property accessors, registered under a custom name, which can then be used here as well.
public abstract String name
SearchableMetaData. Maps to
SearchableMetaData.name().
If no value is defined, will default to the class field/property name.
The meta-data will NOT be auto generated if the field/property have
SearchableMetaData/SearchableMetaDatas AND the
name() is not set.
public abstract float boost
SearchableMetaData. Maps to
SearchableMetaData.boost().
The meta-data will NOT be auto generated if the field/property have
SearchableMetaData/SearchableMetaDatas AND the
name() is not set.
public abstract Store store
SearchableMetaData. Maps to
SearchableMetaData.store().
The meta-data will NOT be auto generated if the field/property have
SearchableMetaData/SearchableMetaDatas AND the
name() is not set.
public abstract Index index
SearchableMetaData. Maps to
SearchableMetaData.index().
The meta-data will NOT be auto generated if the field/property have
SearchableMetaData/SearchableMetaDatas AND the
name() is not set.
public abstract TermVector termVector
SearchableMetaData. Maps to
SearchableMetaData.termVector().
The meta-data will NOT be auto generated if the field/property have
SearchableMetaData/SearchableMetaDatas AND the
name() is not set.
public abstract OmitNorms omitNorms
SearchableMetaData. Maps to
SearchableMetaData.omitNorms().
The meta-data will NOT be auto generated if the field/property have
SearchableMetaData/SearchableMetaDatas AND the
name() is not set.
public abstract OmitTf omitTf
SearchableMetaData. Maps to
SearchableMetaData.omitTf().
The meta-data will NOT be auto generated if the field/property have
SearchableMetaData/SearchableMetaDatas AND the
name() is not set.
public abstract Reverse reverse
SearchableMetaData. Maps to
SearchableMetaData.reverse().
The meta-data will NOT be auto generated if the field/property have
SearchableMetaData/SearchableMetaDatas AND the
name() is not set.
public abstract String analyzer
SearchableMetaData. Maps to
SearchableMetaData.analyzer().
The meta-data will NOT be auto generated if the field/property have
SearchableMetaData/SearchableMetaDatas AND the
name() is not set.
public abstract ExcludeFromAll excludeFromAll
SearchableMetaData. Maps to
SearchableMetaData.excludeFromAll().
The meta-data will NOT be auto generated if the field/property have
SearchableMetaData/SearchableMetaDatas AND the
name() is not set.
public abstract String converter
SearchableMetaData. Maps to
SearchableMetaData.converter().
The meta-data will be auto generated only if the name has a value.
This converter will also be used for an internal meta-data id (if required to be generated).
public abstract String format
SearchableMetaData. Maps to
SearchableMetaData.format().
The meta-data will be auto generated only if the name has a value.
This format will also be used for an internal meta-data id (if required to be generated).
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 | |||||||||