diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml index ed10bb5311a..93fdbc58c27 100644 --- a/.idea/copyright/profiles_settings.xml +++ b/.idea/copyright/profiles_settings.xml @@ -1,5 +1,5 @@ - + diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/doubles/DoubleFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/doubles/DoubleFieldData.java index 8e16cc5b913..5796ca080d6 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/doubles/DoubleFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/doubles/DoubleFieldData.java @@ -121,12 +121,12 @@ public abstract class DoubleFieldData extends NumericFieldData terms.add(FieldCache.NUMERIC_UTILS_FLOAT_PARSER.parseFloat(term)); } - @Override public FloatFieldData buildSingleValue(String field, int[] order) { - return new SingleValueFloatFieldData(field, order, terms.toNativeArray()); + @Override public FloatFieldData buildSingleValue(String field, int[] ordinals) { + return new SingleValueFloatFieldData(field, ordinals, terms.toNativeArray()); } - @Override public FloatFieldData buildMultiValue(String field, int[][] order) { - return new MultiValueFloatFieldData(field, order, terms.toNativeArray()); + @Override public FloatFieldData buildMultiValue(String field, int[][] ordinals) { + return new MultiValueFloatFieldData(field, ordinals, terms.toNativeArray()); } } } \ No newline at end of file diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/floats/MultiValueFloatFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/floats/MultiValueFloatFieldData.java index 1af1e0dfda3..bc593f10b48 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/floats/MultiValueFloatFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/floats/MultiValueFloatFieldData.java @@ -50,11 +50,11 @@ public class MultiValueFloatFieldData extends FloatFieldData { }; // order with value 0 indicates no value - private final int[][] order; + private final int[][] ordinals; - public MultiValueFloatFieldData(String fieldName, int[][] order, float[] values) { + public MultiValueFloatFieldData(String fieldName, int[][] ordinals, float[] values) { super(fieldName, values); - this.order = order; + this.ordinals = ordinals; } @Override public boolean multiValued() { @@ -62,11 +62,11 @@ public class MultiValueFloatFieldData extends FloatFieldData { } @Override public boolean hasValue(int docId) { - return order[docId] != null; + return ordinals[docId] != null; } @Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return; } @@ -76,7 +76,7 @@ public class MultiValueFloatFieldData extends FloatFieldData { } @Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return; } @@ -86,7 +86,7 @@ public class MultiValueFloatFieldData extends FloatFieldData { } @Override public double[] doubleValues(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return DoubleFieldData.EMPTY_DOUBLE_ARRAY; } @@ -103,7 +103,7 @@ public class MultiValueFloatFieldData extends FloatFieldData { } @Override public float value(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return 0; } @@ -111,7 +111,7 @@ public class MultiValueFloatFieldData extends FloatFieldData { } @Override public float[] values(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return EMPTY_FLOAT_ARRAY; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/floats/SingleValueFloatFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/floats/SingleValueFloatFieldData.java index 26f91500444..e453c5adc1d 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/floats/SingleValueFloatFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/floats/SingleValueFloatFieldData.java @@ -40,11 +40,11 @@ public class SingleValueFloatFieldData extends FloatFieldData { }; // order with value 0 indicates no value - private final int[] order; + private final int[] ordinals; - public SingleValueFloatFieldData(String fieldName, int[] order, float[] values) { + public SingleValueFloatFieldData(String fieldName, int[] ordinals, float[] values) { super(fieldName, values); - this.order = order; + this.ordinals = ordinals; } @Override public boolean multiValued() { @@ -52,11 +52,11 @@ public class SingleValueFloatFieldData extends FloatFieldData { } @Override public boolean hasValue(int docId) { - return order[docId] != 0; + return ordinals[docId] != 0; } @Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return; } @@ -64,7 +64,7 @@ public class SingleValueFloatFieldData extends FloatFieldData { } @Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return; } @@ -72,7 +72,7 @@ public class SingleValueFloatFieldData extends FloatFieldData { } @Override public double[] doubleValues(int docId) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return DoubleFieldData.EMPTY_DOUBLE_ARRAY; } @@ -82,11 +82,11 @@ public class SingleValueFloatFieldData extends FloatFieldData { } @Override public float value(int docId) { - return values[order[docId]]; + return values[ordinals[docId]]; } @Override public float[] values(int docId) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return EMPTY_FLOAT_ARRAY; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/ints/IntFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/ints/IntFieldData.java index b14d08a9040..1f6ab721a7f 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/ints/IntFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/ints/IntFieldData.java @@ -121,12 +121,12 @@ public abstract class IntFieldData extends NumericFieldData { terms.add(FieldCache.NUMERIC_UTILS_INT_PARSER.parseInt(term)); } - @Override public IntFieldData buildSingleValue(String field, int[] order) { - return new SingleValueIntFieldData(field, order, terms.toNativeArray()); + @Override public IntFieldData buildSingleValue(String field, int[] ordinals) { + return new SingleValueIntFieldData(field, ordinals, terms.toNativeArray()); } - @Override public IntFieldData buildMultiValue(String field, int[][] order) { - return new MultiValueIntFieldData(field, order, terms.toNativeArray()); + @Override public IntFieldData buildMultiValue(String field, int[][] ordinals) { + return new MultiValueIntFieldData(field, ordinals, terms.toNativeArray()); } } } \ No newline at end of file diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/ints/MultiValueIntFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/ints/MultiValueIntFieldData.java index d95917d0927..15a7c15e62b 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/ints/MultiValueIntFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/ints/MultiValueIntFieldData.java @@ -50,11 +50,11 @@ public class MultiValueIntFieldData extends IntFieldData { }; // order with value 0 indicates no value - private final int[][] order; + private final int[][] ordinals; - public MultiValueIntFieldData(String fieldName, int[][] order, int[] values) { + public MultiValueIntFieldData(String fieldName, int[][] ordinals, int[] values) { super(fieldName, values); - this.order = order; + this.ordinals = ordinals; } @Override public boolean multiValued() { @@ -62,11 +62,11 @@ public class MultiValueIntFieldData extends IntFieldData { } @Override public boolean hasValue(int docId) { - return order[docId] != null; + return ordinals[docId] != null; } @Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return; } @@ -76,7 +76,7 @@ public class MultiValueIntFieldData extends IntFieldData { } @Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return; } @@ -86,7 +86,7 @@ public class MultiValueIntFieldData extends IntFieldData { } @Override public double[] doubleValues(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return DoubleFieldData.EMPTY_DOUBLE_ARRAY; } @@ -103,7 +103,7 @@ public class MultiValueIntFieldData extends IntFieldData { } @Override public int value(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return 0; } @@ -111,7 +111,7 @@ public class MultiValueIntFieldData extends IntFieldData { } @Override public int[] values(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return EMPTY_INT_ARRAY; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/ints/SingleValueIntFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/ints/SingleValueIntFieldData.java index cf02ba647c5..bfe46759310 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/ints/SingleValueIntFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/ints/SingleValueIntFieldData.java @@ -40,11 +40,11 @@ public class SingleValueIntFieldData extends IntFieldData { }; // order with value 0 indicates no value - private final int[] order; + private final int[] ordinals; - public SingleValueIntFieldData(String fieldName, int[] order, int[] values) { + public SingleValueIntFieldData(String fieldName, int[] ordinals, int[] values) { super(fieldName, values); - this.order = order; + this.ordinals = ordinals; } @Override public boolean multiValued() { @@ -52,11 +52,11 @@ public class SingleValueIntFieldData extends IntFieldData { } @Override public boolean hasValue(int docId) { - return order[docId] != 0; + return ordinals[docId] != 0; } @Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return; } @@ -64,7 +64,7 @@ public class SingleValueIntFieldData extends IntFieldData { } @Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return; } @@ -72,7 +72,7 @@ public class SingleValueIntFieldData extends IntFieldData { } @Override public double[] doubleValues(int docId) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return DoubleFieldData.EMPTY_DOUBLE_ARRAY; } @@ -82,11 +82,11 @@ public class SingleValueIntFieldData extends IntFieldData { } @Override public int value(int docId) { - return values[order[docId]]; + return values[ordinals[docId]]; } @Override public int[] values(int docId) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return EMPTY_INT_ARRAY; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/longs/LongFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/longs/LongFieldData.java index 0e26adca109..a6b3c28c2a0 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/longs/LongFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/longs/LongFieldData.java @@ -138,12 +138,12 @@ public abstract class LongFieldData extends NumericFieldData { terms.add(FieldCache.NUMERIC_UTILS_LONG_PARSER.parseLong(term)); } - @Override public LongFieldData buildSingleValue(String field, int[] order) { - return new SingleValueLongFieldData(field, order, terms.toNativeArray()); + @Override public LongFieldData buildSingleValue(String field, int[] ordinals) { + return new SingleValueLongFieldData(field, ordinals, terms.toNativeArray()); } - @Override public LongFieldData buildMultiValue(String field, int[][] order) { - return new MultiValueLongFieldData(field, order, terms.toNativeArray()); + @Override public LongFieldData buildMultiValue(String field, int[][] ordinals) { + return new MultiValueLongFieldData(field, ordinals, terms.toNativeArray()); } } } \ No newline at end of file diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/longs/MultiValueLongFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/longs/MultiValueLongFieldData.java index 653fdd46508..3dd9cd8bccc 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/longs/MultiValueLongFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/longs/MultiValueLongFieldData.java @@ -65,11 +65,11 @@ public class MultiValueLongFieldData extends LongFieldData { }; // order with value 0 indicates no value - private final int[][] order; + private final int[][] ordinals; - public MultiValueLongFieldData(String fieldName, int[][] order, long[] values) { + public MultiValueLongFieldData(String fieldName, int[][] ordinals, long[] values) { super(fieldName, values); - this.order = order; + this.ordinals = ordinals; } @Override public boolean multiValued() { @@ -77,11 +77,11 @@ public class MultiValueLongFieldData extends LongFieldData { } @Override public boolean hasValue(int docId) { - return order[docId] != null; + return ordinals[docId] != null; } @Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return; } @@ -91,7 +91,7 @@ public class MultiValueLongFieldData extends LongFieldData { } @Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return; } @@ -101,7 +101,7 @@ public class MultiValueLongFieldData extends LongFieldData { } @Override public MutableDateTime[] dates(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return EMPTY_DATETIME_ARRAY; } @@ -121,7 +121,7 @@ public class MultiValueLongFieldData extends LongFieldData { } @Override public double[] doubleValues(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return DoubleFieldData.EMPTY_DOUBLE_ARRAY; } @@ -138,7 +138,7 @@ public class MultiValueLongFieldData extends LongFieldData { } @Override public long value(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return 0; } @@ -146,7 +146,7 @@ public class MultiValueLongFieldData extends LongFieldData { } @Override public long[] values(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return EMPTY_LONG_ARRAY; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/longs/SingleValueLongFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/longs/SingleValueLongFieldData.java index 4256605cac4..5249afc2fb1 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/longs/SingleValueLongFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/longs/SingleValueLongFieldData.java @@ -49,11 +49,11 @@ public class SingleValueLongFieldData extends LongFieldData { }; // order with value 0 indicates no value - private final int[] order; + private final int[] ordinals; - public SingleValueLongFieldData(String fieldName, int[] order, long[] values) { + public SingleValueLongFieldData(String fieldName, int[] ordinals, long[] values) { super(fieldName, values); - this.order = order; + this.ordinals = ordinals; } @Override public boolean multiValued() { @@ -61,11 +61,11 @@ public class SingleValueLongFieldData extends LongFieldData { } @Override public boolean hasValue(int docId) { - return order[docId] != 0; + return ordinals[docId] != 0; } @Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return; } @@ -73,7 +73,7 @@ public class SingleValueLongFieldData extends LongFieldData { } @Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return; } @@ -81,7 +81,7 @@ public class SingleValueLongFieldData extends LongFieldData { } @Override public MutableDateTime[] dates(int docId) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return EMPTY_DATETIME_ARRAY; } @@ -91,7 +91,7 @@ public class SingleValueLongFieldData extends LongFieldData { } @Override public double[] doubleValues(int docId) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return DoubleFieldData.EMPTY_DOUBLE_ARRAY; } @@ -101,11 +101,11 @@ public class SingleValueLongFieldData extends LongFieldData { } @Override public long value(int docId) { - return values[order[docId]]; + return values[ordinals[docId]]; } @Override public long[] values(int docId) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return EMPTY_LONG_ARRAY; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/shorts/MultiValueShortFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/shorts/MultiValueShortFieldData.java index 7547a0cbb51..54cd624acdd 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/shorts/MultiValueShortFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/shorts/MultiValueShortFieldData.java @@ -50,11 +50,11 @@ public class MultiValueShortFieldData extends ShortFieldData { }; // order with value 0 indicates no value - private final int[][] order; + private final int[][] ordinals; - public MultiValueShortFieldData(String fieldName, int[][] order, short[] values) { + public MultiValueShortFieldData(String fieldName, int[][] ordinals, short[] values) { super(fieldName, values); - this.order = order; + this.ordinals = ordinals; } @Override public boolean multiValued() { @@ -62,11 +62,11 @@ public class MultiValueShortFieldData extends ShortFieldData { } @Override public boolean hasValue(int docId) { - return order[docId] != null; + return ordinals[docId] != null; } @Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return; } @@ -76,7 +76,7 @@ public class MultiValueShortFieldData extends ShortFieldData { } @Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return; } @@ -86,7 +86,7 @@ public class MultiValueShortFieldData extends ShortFieldData { } @Override public double[] doubleValues(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return DoubleFieldData.EMPTY_DOUBLE_ARRAY; } @@ -103,7 +103,7 @@ public class MultiValueShortFieldData extends ShortFieldData { } @Override public short value(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return 0; } @@ -111,7 +111,7 @@ public class MultiValueShortFieldData extends ShortFieldData { } @Override public short[] values(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return EMPTY_SHORT_ARRAY; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/shorts/ShortFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/shorts/ShortFieldData.java index 8aaa477aadd..299909afbb1 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/shorts/ShortFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/shorts/ShortFieldData.java @@ -121,12 +121,12 @@ public abstract class ShortFieldData extends NumericFieldData terms.add((short) FieldCache.NUMERIC_UTILS_INT_PARSER.parseInt(term)); } - @Override public ShortFieldData buildSingleValue(String field, int[] order) { - return new SingleValueShortFieldData(field, order, terms.toNativeArray()); + @Override public ShortFieldData buildSingleValue(String field, int[] ordinals) { + return new SingleValueShortFieldData(field, ordinals, terms.toNativeArray()); } - @Override public ShortFieldData buildMultiValue(String field, int[][] order) { - return new MultiValueShortFieldData(field, order, terms.toNativeArray()); + @Override public ShortFieldData buildMultiValue(String field, int[][] ordinals) { + return new MultiValueShortFieldData(field, ordinals, terms.toNativeArray()); } } } \ No newline at end of file diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/shorts/SingleValueShortFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/shorts/SingleValueShortFieldData.java index 6df70e27a67..b263e54a3c4 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/shorts/SingleValueShortFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/shorts/SingleValueShortFieldData.java @@ -40,11 +40,11 @@ public class SingleValueShortFieldData extends ShortFieldData { }; // order with value 0 indicates no value - private final int[] order; + private final int[] ordinals; - public SingleValueShortFieldData(String fieldName, int[] order, short[] values) { + public SingleValueShortFieldData(String fieldName, int[] ordinals, short[] values) { super(fieldName, values); - this.order = order; + this.ordinals = ordinals; } @Override public boolean multiValued() { @@ -52,11 +52,11 @@ public class SingleValueShortFieldData extends ShortFieldData { } @Override public boolean hasValue(int docId) { - return order[docId] != 0; + return ordinals[docId] != 0; } @Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return; } @@ -64,7 +64,7 @@ public class SingleValueShortFieldData extends ShortFieldData { } @Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return; } @@ -72,11 +72,11 @@ public class SingleValueShortFieldData extends ShortFieldData { } @Override public short value(int docId) { - return values[order[docId]]; + return values[ordinals[docId]]; } @Override public double[] doubleValues(int docId) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return DoubleFieldData.EMPTY_DOUBLE_ARRAY; } @@ -86,7 +86,7 @@ public class SingleValueShortFieldData extends ShortFieldData { } @Override public short[] values(int docId) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return EMPTY_SHORT_ARRAY; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/MultiValueStringFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/MultiValueStringFieldData.java index 4b9cdfe4092..6ff02df973e 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/MultiValueStringFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/MultiValueStringFieldData.java @@ -40,11 +40,11 @@ public class MultiValueStringFieldData extends StringFieldData { }; // order with value 0 indicates no value - private final int[][] order; + private final int[][] ordinals; - public MultiValueStringFieldData(String fieldName, int[][] order, String[] values) { + public MultiValueStringFieldData(String fieldName, int[][] ordinals, String[] values) { super(fieldName, values); - this.order = order; + this.ordinals = ordinals; } @Override public boolean multiValued() { @@ -52,11 +52,11 @@ public class MultiValueStringFieldData extends StringFieldData { } @Override public boolean hasValue(int docId) { - return order[docId] != null; + return ordinals[docId] != null; } @Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return; } @@ -66,7 +66,7 @@ public class MultiValueStringFieldData extends StringFieldData { } @Override public String value(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return null; } @@ -74,7 +74,7 @@ public class MultiValueStringFieldData extends StringFieldData { } @Override public String[] values(int docId) { - int[] docOrders = order[docId]; + int[] docOrders = ordinals[docId]; if (docOrders == null) { return Strings.EMPTY_ARRAY; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/SingleValueStringFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/SingleValueStringFieldData.java index e58b792d95c..219e9b2fa26 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/SingleValueStringFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/SingleValueStringFieldData.java @@ -34,15 +34,15 @@ public class SingleValueStringFieldData extends StringFieldData { }; // order with value 0 indicates no value - private final int[] order; + private final int[] ordinals; - public SingleValueStringFieldData(String fieldName, int[] order, String[] values) { + public SingleValueStringFieldData(String fieldName, int[] ordinals, String[] values) { super(fieldName, values); - this.order = order; + this.ordinals = ordinals; } - int[] order() { - return order; + int[] ordinals() { + return ordinals; } String[] values() { @@ -54,11 +54,11 @@ public class SingleValueStringFieldData extends StringFieldData { } @Override public boolean hasValue(int docId) { - return order[docId] != 0; + return ordinals[docId] != 0; } @Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return; } @@ -66,11 +66,11 @@ public class SingleValueStringFieldData extends StringFieldData { } @Override public String value(int docId) { - return values[order[docId]]; + return values[ordinals[docId]]; } @Override public String[] values(int docId) { - int loc = order[docId]; + int loc = ordinals[docId]; if (loc == 0) { return Strings.EMPTY_ARRAY; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/StringFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/StringFieldData.java index fc570506b42..f2b5807b23b 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/StringFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/StringFieldData.java @@ -83,12 +83,12 @@ public abstract class StringFieldData extends FieldData { terms.add(term); } - @Override public StringFieldData buildSingleValue(String field, int[] order) { - return new SingleValueStringFieldData(field, order, terms.toArray(new String[terms.size()])); + @Override public StringFieldData buildSingleValue(String field, int[] ordinals) { + return new SingleValueStringFieldData(field, ordinals, terms.toArray(new String[terms.size()])); } - @Override public StringFieldData buildMultiValue(String field, int[][] order) { - return new MultiValueStringFieldData(field, order, terms.toArray(new String[terms.size()])); + @Override public StringFieldData buildMultiValue(String field, int[][] ordinals) { + return new MultiValueStringFieldData(field, ordinals, terms.toArray(new String[terms.size()])); } } } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/StringOrdValFieldDataComparator.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/StringOrdValFieldDataComparator.java index 47daf70f7d3..0a7679a8b5f 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/StringOrdValFieldDataComparator.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/strings/StringOrdValFieldDataComparator.java @@ -147,7 +147,7 @@ public class StringOrdValFieldDataComparator extends FieldComparator { } SingleValueStringFieldData fieldData = (SingleValueStringFieldData) cleanFieldData; currentReaderGen++; - order = fieldData.order(); + order = fieldData.ordinals(); lookup = fieldData.values(); assert lookup.length > 0; if (bottomSlot != -1) { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/support/FieldDataLoader.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/support/FieldDataLoader.java index 5a1e8900272..915a4c3dd64 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/support/FieldDataLoader.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/field/data/support/FieldDataLoader.java @@ -40,7 +40,7 @@ public class FieldDataLoader { loader.init(); field = StringHelper.intern(field); - int[][] orders = new int[reader.maxDoc()][]; + int[][] ordinals = new int[reader.maxDoc()][]; int t = 1; // current term number @@ -55,16 +55,16 @@ public class FieldDataLoader { termDocs.seek(termEnum); while (termDocs.next()) { int doc = termDocs.doc(); - int[] orderPerDoc = orders[doc]; - if (orderPerDoc == null) { - orderPerDoc = new int[1]; - orderPerDoc[0] = t; - orders[doc] = orderPerDoc; + int[] ordinalPerDoc = ordinals[doc]; + if (ordinalPerDoc == null) { + ordinalPerDoc = new int[1]; + ordinalPerDoc[0] = t; + ordinals[doc] = ordinalPerDoc; } else { multiValued = true; - orderPerDoc = Arrays.copyOf(orderPerDoc, orderPerDoc.length + 1); - orderPerDoc[orderPerDoc.length - 1] = t; - orders[doc] = orderPerDoc; + ordinalPerDoc = Arrays.copyOf(ordinalPerDoc, ordinalPerDoc.length + 1); + ordinalPerDoc[ordinalPerDoc.length - 1] = t; + ordinals[doc] = ordinalPerDoc; } } @@ -82,13 +82,13 @@ public class FieldDataLoader { } if (multiValued) { - return loader.buildMultiValue(field, orders); + return loader.buildMultiValue(field, ordinals); } else { // optimize for a single valued int[] sOrders = new int[reader.maxDoc()]; - for (int i = 0; i < orders.length; i++) { - if (orders[i] != null) { - sOrders[i] = orders[i][0]; + for (int i = 0; i < ordinals.length; i++) { + if (ordinals[i] != null) { + sOrders[i] = ordinals[i][0]; } } return loader.buildSingleValue(field, sOrders); @@ -101,9 +101,9 @@ public class FieldDataLoader { void collectTerm(String term); - T buildSingleValue(String fieldName, int[] order); + T buildSingleValue(String fieldName, int[] ordinals); - T buildMultiValue(String fieldName, int[][] order); + T buildMultiValue(String fieldName, int[][] ordinals); } public static abstract class FreqsTypeLoader implements TypeLoader { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/xcontent/geo/GeoPointFieldData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/xcontent/geo/GeoPointFieldData.java index 62d9b0393a9..e3c7bd75ea8 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/xcontent/geo/GeoPointFieldData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/xcontent/geo/GeoPointFieldData.java @@ -130,12 +130,12 @@ public abstract class GeoPointFieldData extends FieldData } - @Override public GeoPointFieldData buildSingleValue(String field, int[] order) { - return new SingleValueGeoPointFieldData(field, order, lat.toNativeArray(), lon.toNativeArray()); + @Override public GeoPointFieldData buildSingleValue(String field, int[] ordinals) { + return new SingleValueGeoPointFieldData(field, ordinals, lat.toNativeArray(), lon.toNativeArray()); } - @Override public GeoPointFieldData buildMultiValue(String field, int[][] order) { - return new MultiValueGeoPointFieldData(field, order, lat.toNativeArray(), lon.toNativeArray()); + @Override public GeoPointFieldData buildMultiValue(String field, int[][] ordinals) { + return new MultiValueGeoPointFieldData(field, ordinals, lat.toNativeArray(), lon.toNativeArray()); } } }