org.apache.lucene.document.DoubleField Java Examples
The following examples show how to use
org.apache.lucene.document.DoubleField.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DoubleFieldTypeDefinition.java From incubator-retired-blur with Apache License 2.0 | 6 votes |
@Override public void configure(String fieldNameForThisInstance, Map<String, String> properties, Configuration configuration) { String precisionStepStr = properties.get(NUMERIC_PRECISION_STEP); if (precisionStepStr != null) { _precisionStep = Integer.parseInt(precisionStepStr); _typeStored = new FieldType(DoubleField.TYPE_STORED); _typeStored.setNumericPrecisionStep(_precisionStep); _typeStored.freeze(); _typeNotStored = new FieldType(DoubleField.TYPE_NOT_STORED); _typeNotStored.setNumericPrecisionStep(_precisionStep); _typeNotStored.freeze(); } else { _typeStored = DoubleField.TYPE_STORED; _typeNotStored = DoubleField.TYPE_NOT_STORED; } }
Example #2
Source File: IndexedField.java From sql-layer with GNU Affero General Public License v3.0 | 5 votes |
public Field getField(ValueSource value) { if (value.isNull()) return null; Field.Store store = Field.Store.NO; // Only store hkey. switch (fieldType) { case INT: switch (TInstance.underlyingType(value.getType())) { case INT_8: return new IntField(name, value.getInt8(), store); case INT_16: return new IntField(name, value.getInt16(), store); case UINT_16: return new IntField(name, value.getUInt16(), store); case INT_32: default: return new IntField(name, value.getInt32(), store); } case LONG: return new LongField(name, value.getInt64(), store); case FLOAT: return new FloatField(name, value.getFloat(), store); case DOUBLE: return new DoubleField(name, value.getDouble(), store); case STRING: switch (TInstance.underlyingType(value.getType())) { case STRING: return new StringField(name, value.getString(), store); default: { StringBuilder str = new StringBuilder(); value.getType().format(value, AkibanAppender.of(str)); return new StringField(name, str.toString(), store); } } case TEXT: return new TextField(name, value.getString(), store); default: return null; } }
Example #3
Source File: DoubleFieldTypeDefinition.java From incubator-retired-blur with Apache License 2.0 | 5 votes |
@Override public Iterable<? extends Field> getFieldsForColumn(String family, Column column) { String name = getName(family, column.getName()); double value = Double.parseDouble(column.getValue()); DoubleField field = new DoubleField(name, value, _typeStored); if (isSortEnable()) { return addSort(name, Double.doubleToRawLongBits(value), field); } return makeIterable(field); }
Example #4
Source File: DoubleFieldTypeDefinition.java From incubator-retired-blur with Apache License 2.0 | 5 votes |
@Override public Iterable<? extends Field> getFieldsForSubColumn(String family, Column column, String subName) { String name = getName(family, column.getName(), subName); double value = Double.parseDouble(column.getValue()); DoubleField field = new DoubleField(name, value, _typeNotStored); if (isSortEnable()) { return addSort(name, Double.doubleToRawLongBits(value), field); } return makeIterable(field); }