Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ public interface AtomicFieldData extends Accountable, Releasable {
*/
ScriptDocValues<?> getScriptValues();

/**
* Returns field values for use by returned hits.
*/
default ScriptDocValues<?> getLegacyFieldValues() {
return getScriptValues();
}

/**
* Return a String representation of the values.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
import org.elasticsearch.index.fielddata.ScriptDocValues;
import org.elasticsearch.index.fielddata.SortedBinaryDocValues;
import org.elasticsearch.index.fielddata.SortedNumericDoubleValues;
import org.elasticsearch.script.JodaCompatibleZonedDateTime;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;

import java.io.IOException;

/**
* Specialization of {@link AtomicNumericFieldData} for integers.
Expand All @@ -52,34 +47,6 @@ public long ramBytesUsed() {
return ramBytesUsed;
}

@Override
public final ScriptDocValues<?> getLegacyFieldValues() {
switch (numericType) {
case DATE:
final ScriptDocValues.Dates realDV = new ScriptDocValues.Dates(getLongValues());
return new ScriptDocValues<DateTime>() {

@Override
public int size() {
return realDV.size();
}

@Override
public DateTime get(int index) {
JodaCompatibleZonedDateTime dt = realDV.get(index);
return new DateTime(dt.toInstant().toEpochMilli(), DateTimeZone.UTC);
}

@Override
public void setNextDocId(int docId) throws IOException {
realDV.setNextDocId(docId);
}
};
default:
return getScriptValues();
}
}

@Override
public final ScriptDocValues<?> getScriptValues() {
switch (numericType) {
Expand Down