|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value={METHOD,FIELD}) @Retention(value=RUNTIME) public @interface SearchableDynamicProperty
Specifies a searchable dynamic property on property or field of the Searchable
class.
Dynamic property is a proeprty where the Resource Property name is dynamic in addition to the value itself.
The annotation can be placed on a custom type (or an array / collection of it). When used on a custom type,
the field/property of the custom type for the dynamic name, and the field/property of the custom type for the dynamic value
should be explciitly set using nameProperty()
and valueProperty()
. Another option, instead of setting
them, is by using SearchableDynamicName
on the custom type field/property and
SearchableDynamicValue
on the custom type field/property.
The annotation can also be placed on a Map
type, where its key will act as the Resource property
name and its value will act as the Resource property value. The Map value can also be an array or collection. It is
best to use generics when defining the Map.
When annotating a Map, the nameProperty()
or valueConverter()
(or their respective annotation)
can also be used in case the Map key and/or Map value are custom types.
The format for the name can be set using nameFormat()
and the format for the value can be set using
valueFormat()
.
Optional Element Summary | |
---|---|
String |
accessor
The property accessor that will be fetch and write the property value. |
float |
boost
The boost level for the meta-data. |
String |
converter
The converter lookup name for the given meta-data. |
Index |
index
Specifies whether and how a meta-data proeprty should be indexed. |
String |
nameConverter
Explicitly set the name converter lookup name that will be used to convert the name. |
String |
nameFormat
The format to apply to the name. |
String |
namePrefix
A prefix that will be prepended to the dynamic proeprty names that will be created. |
String |
nameProperty
When the name is a custom object, the name property can get field/property from it and use it as the resource property name. |
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. |
boolean |
override
If there is already an existing id with the same field/property name defined, will override it. |
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. |
String |
valueConverter
Explicitly set the value converter lookup name that will be used to convert the value. |
String |
valueFormat
The format to apply to the value. |
String |
valueProperty
When the name is a custom object, the value property can get field/property from it and use it as the resource property value. |
public abstract String namePrefix
public abstract String nameProperty
SearchableDynamicName
annotation as well.
public abstract String valueProperty
SearchableDynamicValue
annotation as well.
public abstract String nameFormat
public abstract String valueFormat
public abstract String nameConverter
public abstract String valueConverter
public abstract boolean override
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 float boost
public abstract Store store
public abstract Index index
public abstract TermVector termVector
public abstract OmitNorms omitNorms
public abstract OmitTf omitTf
public abstract String converter
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$
).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |