I was writing a custom Aggrigation module and till ES 1.7.1 I was using DoubleFieldSource which used to fetch the data from FieldData.
However when upgrading my custom plugin to ES 2.1.1, I found that DoubleFieldSource reads from DocValues even when docValues are not enabled. here is the code snippet from DoubleFieldSource.java where it does not check if docValues is enabled, it simply reads from docvalues.
@Override
public FunctionValues getValues(Map context, LeafReaderContext readerContext) throws IOException {
final NumericDocValues arr = DocValues.getNumeric(readerContext.reader(), field);
final Bits valid = DocValues.getDocsWithField(readerContext.reader(), field);
return new DoubleDocValues(this) {
When Trying to use DoubleFIeldSource I get the following error
unexpected docvalues type NONE for field 'fileExtensionId' (expected=NUMERIC). Use UninvertingReader or index with docvalues.
The field fileExtensionId has docValues = false and has been indexed thus. Is there any substitute for DoubleFieldSource ? or is this a bug?