scriptValues = data.getLegacyFieldValues(); } else if (indexFieldData instanceof IndexNumericFieldData) { if (((IndexNumericFieldData) indexFieldData).getNumericType().isFloatingPoint()) { doubleValues = ((AtomicNumericFieldData) data).getDoubleValues(); } else {
/** * Instantiates a new reusable {@link NumericTermStream} based on the field type. */ public static NumericTermStream get(IndexReader reader, IndexFieldData indexFieldData) { if (indexFieldData instanceof IndexNumericFieldData) { IndexNumericFieldData numFieldData = (IndexNumericFieldData) indexFieldData; if (!numFieldData.getNumericType().isFloatingPoint()) { return new LongTermStream(reader, numFieldData); } else { throw new UnsupportedOperationException("Streaming floating points is unsupported"); } } else { return new HashTermStream(reader, indexFieldData); } }
scriptValues = data.getScriptValues(); } else if (indexFieldData instanceof IndexNumericFieldData) { if (((IndexNumericFieldData) indexFieldData).getNumericType().isFloatingPoint()) { doubleValues = ((AtomicNumericFieldData) data).getDoubleValues(); } else {
assert !getNumericType().isFloatingPoint(); boolean success = false; try (OrdinalsBuilder builder = new OrdinalsBuilder(-1, reader.maxDoc(), acceptableTransientOverheadRatio)) {
scriptValues = data.getLegacyFieldValues(); } else if (indexFieldData instanceof IndexNumericFieldData) { if (((IndexNumericFieldData) indexFieldData).getNumericType().isFloatingPoint()) { doubleValues = ((AtomicNumericFieldData) data).getDoubleValues(); } else {
assert !numericType.isFloatingPoint(); source = new LongValuesComparatorSource(this, missingValue, sortMode, nested); break; assert !numericType.isFloatingPoint(); sortField = new SortedNumericSortField(fieldName, SortField.Type.LONG, reverse, selectorType); break;
assert !numericType.isFloatingPoint(); source = new LongValuesComparatorSource(this, missingValue, sortMode, nested); break; assert !numericType.isFloatingPoint(); sortField = new SortedNumericSortField(fieldName, SortField.Type.LONG, reverse, selectorType); break;
try { final BinaryDocValues values = DocValues.getBinary(context.reader(), fieldNames.indexName()); if (numericType.isFloatingPoint()) { return new AtomicDoubleFieldData(-1) {
assert !numericType.isFloatingPoint(); source = new LongValuesComparatorSource(this, missingValue, sortMode, nested); break; assert !numericType.isFloatingPoint(); sortField = new SortedNumericSortField(fieldName, SortField.Type.LONG, reverse, selectorType); break;
@Override public DocIdSet getDocIdSet(LeafReaderContext context) throws IOException { final NumericTermsSet termsSet = this.getTermsSet(); // make sure there are terms to filter on if (termsSet == null || termsSet.isEmpty()) return null; IndexNumericFieldData numericFieldData = (IndexNumericFieldData) fieldData; if (!numericFieldData.getNumericType().isFloatingPoint()) { final SortedNumericDocValues values = numericFieldData.load(context).getLongValues(); // load fielddata return new DocValuesDocIdSet(context.reader().maxDoc(), context.reader().getLiveDocs()) { @Override protected boolean matchDoc(int doc) { values.setDocument(doc); final int numVals = values.count(); for (int i = 0; i < numVals; i++) { if (termsSet.contains(values.valueAt(i))) { return true; } } return false; } }; } // only get here if wrong fielddata type in which case // no docs will match so we just return null. return null; }
@Override public boolean isFloatingPoint() { return indexFieldData.getNumericType().isFloatingPoint(); }
@Override public boolean isFloatingPoint() { return indexFieldData.getNumericType().isFloatingPoint(); }
@Override public boolean isFloatingPoint() { return indexFieldData.getNumericType().isFloatingPoint(); }
@Override public boolean isFloatingPoint() { return indexFieldData.getNumericType().isFloatingPoint(); }
@Override public org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource comparatorSource(Object missingValue, MultiValueMode sortMode, Nested nested) { switch (numericType) { case FLOAT: return new FloatValuesComparatorSource(this, missingValue, sortMode, nested); case DOUBLE: return new DoubleValuesComparatorSource(this, missingValue, sortMode, nested); default: assert !numericType.isFloatingPoint(); return new LongValuesComparatorSource(this, missingValue, sortMode, nested); } }
@Override public org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource comparatorSource(final Object missingValue, final MultiValueMode sortMode, Nested nested) { switch (numericType) { case FLOAT: return new FloatValuesComparatorSource(this, missingValue, sortMode, nested); case DOUBLE: return new DoubleValuesComparatorSource(this, missingValue, sortMode, nested); default: assert !numericType.isFloatingPoint(); return new LongValuesComparatorSource(this, missingValue, sortMode, nested); } }
assert !numericType.isFloatingPoint(); source = new LongValuesComparatorSource(this, missingValue, sortMode, nested); break; assert !numericType.isFloatingPoint(); sortField = new SortedNumericSortField(fieldName, SortField.Type.LONG, reverse, selectorType); break;
@Override public boolean isFloatingPoint() { return indexFieldData.getNumericType().isFloatingPoint(); }