public class AttrFieldBridge implements FieldBridge {
public void set(String name, Object value, Document document, LuceneOptions luceneOptions) {
if (value != null) {
@SuppressWarnings("unchecked")
List<Attribute> attrs = (List<Attribute>) value;
for (Attribute attr : attrs){
String fieldName = name+"_"+attr.getAttributeId();
double fieldValue = attr.getVal();
document.add(new DoubleDocValuesField(fieldName, fieldValue));
document.add(new DoubleField(fieldName, fieldValue, Field.Store.NO));
}
}
}