Java Code Examples for org.apache.lucene.document.FieldType#setNumericPrecisionStep()
The following examples show how to use
org.apache.lucene.document.FieldType#setNumericPrecisionStep() .
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: DateFieldTypeDefinition.java From incubator-retired-blur with Apache License 2.0 | 6 votes |
@Override public void configure(String fieldNameForThisInstance, Map<String, String> properties, Configuration configuration) { final String dateFormat = properties.get(DATE_FORMAT); if (dateFormat == null) { throw new RuntimeException("The property [" + DATE_FORMAT + "] can not be null."); } final String timeUnitStr = properties.get(TIME_UNIT); if (timeUnitStr != null) { _timeUnit = TimeUnit.valueOf(timeUnitStr.trim().toUpperCase()); } _simpleDateFormat = new ThreadValue<SimpleDateFormat>() { @Override protected SimpleDateFormat initialValue() { return new SimpleDateFormat(dateFormat); } }; String precisionStepStr = properties.get(NUMERIC_PRECISION_STEP); if (precisionStepStr != null) { _precisionStep = Integer.parseInt(precisionStepStr); _typeNotStored = new FieldType(LongField.TYPE_NOT_STORED); _typeNotStored.setNumericPrecisionStep(_precisionStep); _typeNotStored.freeze(); } else { _typeNotStored = LongField.TYPE_NOT_STORED; } }
Example 2
Source File: LongFieldTypeDefinition.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(LongField.TYPE_STORED); _typeStored.setNumericPrecisionStep(_precisionStep); _typeStored.freeze(); _typeNotStored = new FieldType(LongField.TYPE_NOT_STORED); _typeNotStored.setNumericPrecisionStep(_precisionStep); _typeNotStored.freeze(); } else { _typeStored = LongField.TYPE_STORED; _typeNotStored = LongField.TYPE_NOT_STORED; } }
Example 3
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 4
Source File: IntFieldTypeDefinition.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(IntField.TYPE_STORED); _typeStored.setNumericPrecisionStep(_precisionStep); _typeStored.freeze(); _typeNotStored = new FieldType(IntField.TYPE_NOT_STORED); _typeNotStored.setNumericPrecisionStep(_precisionStep); _typeNotStored.freeze(); } else { _typeStored = IntField.TYPE_STORED; _typeNotStored = IntField.TYPE_NOT_STORED; } }
Example 5
Source File: FloatFieldTypeDefinition.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(FloatField.TYPE_STORED); _typeStored.setNumericPrecisionStep(_precisionStep); _typeStored.freeze(); _typeNotStored = new FieldType(FloatField.TYPE_NOT_STORED); _typeNotStored.setNumericPrecisionStep(_precisionStep); _typeNotStored.freeze(); } else { _typeStored = FloatField.TYPE_STORED; _typeNotStored = FloatField.TYPE_NOT_STORED; } }