Package org.elasticsearch.index.fielddata

Examples of org.elasticsearch.index.fielddata.SortedNumericDoubleValues


        return valuesSource != null;
    }

    @Override
    public void setNextReader(LeafReaderContext reader) {
        final SortedNumericDoubleValues values = valuesSource.doubleValues();
        this.values = MultiValueMode.MIN.select(values, Double.POSITIVE_INFINITY);
    }
View Full Code Here


        // NOTE: it's important to pass null as a missing value in the constructor so that
        // the comparator doesn't check docsWithField since we replace missing values in select()
        return new FieldComparator.FloatComparator(numHits, null, null) {
            @Override
            protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException {
                final SortedNumericDoubleValues values = indexFieldData.load(context).getDoubleValues();
                final NumericDoubleValues selectedValues;
                if (nested == null) {
                    selectedValues = sortMode.select(values, dMissingValue);
                } else {
                    final BitSet rootDocs = nested.rootDocs(context).bits();
View Full Code Here

            if (terms == null || terms.isEmpty()) return null;

            // verify we have a floating point numeric fielddata
            IndexNumericFieldData indexNumericFieldData = (IndexNumericFieldData) fieldData;
            if (indexNumericFieldData.getNumericType().isFloatingPoint()) {
                final SortedNumericDoubleValues values = indexNumericFieldData.load(context).getDoubleValues(); // load fielddata
                return new DocValuesDocIdSet(context.reader().maxDoc(), acceptDocs) {
                    @Override
                    protected boolean matchDoc(int doc) {
                        values.setDocument(doc);
                        final int numVals = values.count();

                        for (int i = 0; i < numVals; i++) {
                            if (terms.contains(values.valueAt(i))) {
                                return true;
                            }
                        }

                        return false;
View Full Code Here

        return valuesSource != null;
    }

    @Override
    public void setNextReader(LeafReaderContext reader) {
        final SortedNumericDoubleValues values = valuesSource.doubleValues();
        this.values = MultiValueMode.MAX.select(values, Double.NEGATIVE_INFINITY);
    }
View Full Code Here

        // NOTE: it's important to pass null as a missing value in the constructor so that
        // the comparator doesn't check docsWithField since we replace missing values in select()
        return new FieldComparator.DoubleComparator(numHits, null, null) {
            @Override
            protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException {
                final SortedNumericDoubleValues values = getValues(context);
                final NumericDoubleValues selectedValues;
                if (nested == null) {
                    selectedValues = sortMode.select(values, dMissingValue);
                } else {
                    final BitSet rootDocs = nested.rootDocs(context).bits();
View Full Code Here

                }

                if (inclusiveLowerPoint > inclusiveUpperPoint)
                    return null;

                final SortedNumericDoubleValues values = indexFieldData.load(ctx).getDoubleValues();
                return new DoubleRangeMatchDocIdSet(ctx.reader().maxDoc(), acceptedDocs, values, inclusiveLowerPoint, inclusiveUpperPoint);
            }
        };
    }
View Full Code Here

                }

                if (inclusiveLowerPoint > inclusiveUpperPoint)
                    return null;

                final SortedNumericDoubleValues values = indexFieldData.load(ctx).getDoubleValues();
                return new DoubleRangeMatchDocIdSet(ctx.reader().maxDoc(), acceptedDocs, values, inclusiveLowerPoint, inclusiveUpperPoint);
            }
        };
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.fielddata.SortedNumericDoubleValues

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.