Skip to content

Commit

Permalink
Making use of IntField instead of IntPoint
Browse files Browse the repository at this point in the history
Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>
  • Loading branch information
harshavamsi committed Nov 15, 2023
1 parent e43d203 commit 6a324a4
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.exc.InputCoercionException;

import org.apache.lucene.document.DoubleField;
import org.apache.lucene.document.DoublePoint;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FloatField;
import org.apache.lucene.document.FloatPoint;
import org.apache.lucene.document.IntField;
import org.apache.lucene.document.IntPoint;
import org.apache.lucene.document.LongField;
import org.apache.lucene.document.LongPoint;
import org.apache.lucene.document.SortedNumericDocValuesField;
import org.apache.lucene.document.StoredField;
Expand All @@ -63,6 +67,7 @@
import org.opensearch.index.document.SortedUnsignedLongDocValuesRangeQuery;
import org.opensearch.index.fielddata.IndexFieldData;
import org.opensearch.index.fielddata.IndexNumericFieldData.NumericType;
import org.opensearch.index.fielddata.SortedNumericDoubleValues;
import org.opensearch.index.fielddata.plain.SortedNumericIndexFieldData;
import org.opensearch.index.query.QueryShardContext;
import org.opensearch.search.DocValueFormat;
Expand Down Expand Up @@ -217,7 +222,7 @@ public Query termsQuery(String field, List<Object> values) {
for (int i = 0; i < values.size(); ++i) {
v[i] = parse(values.get(i), false);
}
return HalfFloatPoint.newSetQuery(field, v);
return FloatField.newSetQuery(field, v);
}

@Override
Expand Down Expand Up @@ -330,7 +335,7 @@ public Query termsQuery(String field, List<Object> values) {
for (int i = 0; i < values.size(); ++i) {
v[i] = parse(values.get(i), false);
}
return FloatPoint.newSetQuery(field, v);
return FloatField.newSetQuery(field, v);
}

@Override
Expand Down Expand Up @@ -432,7 +437,7 @@ public Query termsQuery(String field, List<Object> values) {
for (int i = 0; i < values.size(); ++i) {
v[i] = parse(values.get(i), false);
}
return DoublePoint.newSetQuery(field, v);
return DoubleField.newSetQuery(field, v);
}

@Override
Expand Down Expand Up @@ -684,7 +689,7 @@ public Query termsQuery(String field, List<Object> values) {
if (upTo != v.length) {
v = Arrays.copyOf(v, upTo);
}
return IntPoint.newSetQuery(field, v);
return IntField.newSetQuery(field, v);
}

@Override
Expand Down Expand Up @@ -803,7 +808,7 @@ public Query termsQuery(String field, List<Object> values) {
if (upTo != v.length) {
v = Arrays.copyOf(v, upTo);
}
return LongPoint.newSetQuery(field, v);
return LongField.newSetQuery(field, v);
}

@Override
Expand Down Expand Up @@ -893,6 +898,7 @@ public Query termsQuery(String field, List<Object> values) {
v = Arrays.copyOf(v, upTo);
}

// TODO: replace this with IODVQ
return BigIntegerPoint.newSetQuery(field, v);
}

Expand Down

0 comments on commit 6a324a4

Please sign in to comment.