float boost = 0.0f;
for (FieldWritable field : fields) {
// save the boost factor as unindexed fields, to show different scoring
FieldType type = field.getType();
if (type == FieldType.BOOST) {
float fieldBoost = field.getBoost();
boost += fieldBoost;
doc.add(new Field(Fields.BOOSTFACTOR, field.getValue() + ": "
+ fieldBoost, Field.Store.YES, Field.Index.NO));