The Hibernate Search @Field annotation gives the option to choose index name for a property:
...
@Field(name="somethingOrOther")
public String getSomeValue() {
...
The user guide says this about the name property of the @Field annotation:
name : describe under which name, the property should be stored in the Lucene Document. The default value is the property name (following the JavaBeans convention)
Is there any way to set the name to another value from the annotated bean?
Something like
...
public String getFieldName() {
return fieldName;
}
@Field(name="{fieldName}")
public String getFieldValue() {
return fieldValue;
}
where {fieldName} will be replaced with the result of getFieldName().