Search in sources :

Example 6 with AtomicNumericFieldData

use of org.elasticsearch.index.fielddata.AtomicNumericFieldData in project elasticsearch by elastic.

the class FieldDataValueSource method getValues.

@Override
// ValueSource uses a rawtype
@SuppressWarnings("rawtypes")
public FunctionValues getValues(Map context, LeafReaderContext leaf) throws IOException {
    AtomicNumericFieldData leafData = (AtomicNumericFieldData) fieldData.load(leaf);
    NumericDoubleValues docValues = multiValueMode.select(leafData.getDoubleValues(), 0d);
    return new DoubleDocValues(this) {

        @Override
        public double doubleVal(int doc) {
            return docValues.get(doc);
        }
    };
}
Also used : DoubleDocValues(org.apache.lucene.queries.function.docvalues.DoubleDocValues) NumericDoubleValues(org.elasticsearch.index.fielddata.NumericDoubleValues) AtomicNumericFieldData(org.elasticsearch.index.fielddata.AtomicNumericFieldData)

Aggregations

AtomicNumericFieldData (org.elasticsearch.index.fielddata.AtomicNumericFieldData)6 DoubleDocValues (org.apache.lucene.queries.function.docvalues.DoubleDocValues)5 NumericDoubleValues (org.elasticsearch.index.fielddata.NumericDoubleValues)3 SortedNumericDoubleValues (org.elasticsearch.index.fielddata.SortedNumericDoubleValues)3 Calendar (java.util.Calendar)1 Document (org.apache.lucene.document.Document)1 SortedNumericDocValuesField (org.apache.lucene.document.SortedNumericDocValuesField)1 DirectoryReader (org.apache.lucene.index.DirectoryReader)1 IndexWriter (org.apache.lucene.index.IndexWriter)1 IndexWriterConfig (org.apache.lucene.index.IndexWriterConfig)1 Directory (org.apache.lucene.store.Directory)1 IndexMetaData (org.elasticsearch.cluster.metadata.IndexMetaData)1 IndexSettings (org.elasticsearch.index.IndexSettings)1 IndexNumericFieldData (org.elasticsearch.index.fielddata.IndexNumericFieldData)1 MutableDateTime (org.joda.time.MutableDateTime)1