No, I use a FieldBrigde for this case which writes a NumericField to the index.
My entity looks like:
Code:
public class MyEntity {
...
@Field
@FieldBridge(impl=PropertiesBridge.class)
protected List<Property> properties;
...
}
The field bridge converts the properties to fields like this:
Code:
public class PropertiesBridge implements FieldBridge {
public void set(String name, Object value, Document document, LuceneOptions luceneOptions) {
if (value != null && value instanceof List<?>) {
List<Property> properties = (List<Property>) value;
for (Property property: properties) {
if (property.getType() == PropertyType.Double) {
NumericField field = new NumericField(property.getName(), Store.YES, true);
field.setDoubleValue((Double)property.getValue());
document.add(field);
}
}
}
}
Isn't that the same like a @NumericField?