correct field name
This commit is contained in:
parent
f9716dfcfe
commit
22c27e4ff8
|
@ -1,5 +1,5 @@
|
||||||
<component name="CopyrightManager">
|
<component name="CopyrightManager">
|
||||||
<settings default="">
|
<settings default="apache">
|
||||||
<module2copyright>
|
<module2copyright>
|
||||||
<element module="All" copyright="apache" />
|
<element module="All" copyright="apache" />
|
||||||
</module2copyright>
|
</module2copyright>
|
||||||
|
|
|
@ -121,12 +121,12 @@ public abstract class DoubleFieldData extends NumericFieldData<DoubleDocFieldDat
|
||||||
terms.add(FieldCache.NUMERIC_UTILS_DOUBLE_PARSER.parseDouble(term));
|
terms.add(FieldCache.NUMERIC_UTILS_DOUBLE_PARSER.parseDouble(term));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public DoubleFieldData buildSingleValue(String field, int[] order) {
|
@Override public DoubleFieldData buildSingleValue(String field, int[] ordinals) {
|
||||||
return new SingleValueDoubleFieldData(field, order, terms.toNativeArray());
|
return new SingleValueDoubleFieldData(field, ordinals, terms.toNativeArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public DoubleFieldData buildMultiValue(String field, int[][] order) {
|
@Override public DoubleFieldData buildMultiValue(String field, int[][] ordinals) {
|
||||||
return new MultiValueDoubleFieldData(field, order, terms.toNativeArray());
|
return new MultiValueDoubleFieldData(field, ordinals, terms.toNativeArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -39,11 +39,11 @@ public class MultiValueDoubleFieldData extends DoubleFieldData {
|
||||||
};
|
};
|
||||||
|
|
||||||
// order with value 0 indicates no value
|
// order with value 0 indicates no value
|
||||||
private final int[][] order;
|
private final int[][] ordinals;
|
||||||
|
|
||||||
public MultiValueDoubleFieldData(String fieldName, int[][] order, double[] values) {
|
public MultiValueDoubleFieldData(String fieldName, int[][] ordinals, double[] values) {
|
||||||
super(fieldName, values);
|
super(fieldName, values);
|
||||||
this.order = order;
|
this.ordinals = ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean multiValued() {
|
@Override public boolean multiValued() {
|
||||||
|
@ -51,11 +51,11 @@ public class MultiValueDoubleFieldData extends DoubleFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean hasValue(int docId) {
|
@Override public boolean hasValue(int docId) {
|
||||||
return order[docId] != null;
|
return ordinals[docId] != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ public class MultiValueDoubleFieldData extends DoubleFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ public class MultiValueDoubleFieldData extends DoubleFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public double value(int docId) {
|
@Override public double value(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ public class MultiValueDoubleFieldData extends DoubleFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public double[] values(int docId) {
|
@Override public double[] values(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return EMPTY_DOUBLE_ARRAY;
|
return EMPTY_DOUBLE_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,11 +33,11 @@ public class SingleValueDoubleFieldData extends DoubleFieldData {
|
||||||
};
|
};
|
||||||
|
|
||||||
// order with value 0 indicates no value
|
// order with value 0 indicates no value
|
||||||
private final int[] order;
|
private final int[] ordinals;
|
||||||
|
|
||||||
public SingleValueDoubleFieldData(String fieldName, int[] order, double[] values) {
|
public SingleValueDoubleFieldData(String fieldName, int[] ordinals, double[] values) {
|
||||||
super(fieldName, values);
|
super(fieldName, values);
|
||||||
this.order = order;
|
this.ordinals = ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean multiValued() {
|
@Override public boolean multiValued() {
|
||||||
|
@ -45,11 +45,11 @@ public class SingleValueDoubleFieldData extends DoubleFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean hasValue(int docId) {
|
@Override public boolean hasValue(int docId) {
|
||||||
return order[docId] != 0;
|
return ordinals[docId] != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ public class SingleValueDoubleFieldData extends DoubleFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -69,11 +69,11 @@ public class SingleValueDoubleFieldData extends DoubleFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public double value(int docId) {
|
@Override public double value(int docId) {
|
||||||
return values[order[docId]];
|
return values[ordinals[docId]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public double[] values(int docId) {
|
@Override public double[] values(int docId) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return EMPTY_DOUBLE_ARRAY;
|
return EMPTY_DOUBLE_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,12 +121,12 @@ public abstract class FloatFieldData extends NumericFieldData<FloatDocFieldData>
|
||||||
terms.add(FieldCache.NUMERIC_UTILS_FLOAT_PARSER.parseFloat(term));
|
terms.add(FieldCache.NUMERIC_UTILS_FLOAT_PARSER.parseFloat(term));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public FloatFieldData buildSingleValue(String field, int[] order) {
|
@Override public FloatFieldData buildSingleValue(String field, int[] ordinals) {
|
||||||
return new SingleValueFloatFieldData(field, order, terms.toNativeArray());
|
return new SingleValueFloatFieldData(field, ordinals, terms.toNativeArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public FloatFieldData buildMultiValue(String field, int[][] order) {
|
@Override public FloatFieldData buildMultiValue(String field, int[][] ordinals) {
|
||||||
return new MultiValueFloatFieldData(field, order, terms.toNativeArray());
|
return new MultiValueFloatFieldData(field, ordinals, terms.toNativeArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -50,11 +50,11 @@ public class MultiValueFloatFieldData extends FloatFieldData {
|
||||||
};
|
};
|
||||||
|
|
||||||
// order with value 0 indicates no value
|
// 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);
|
super(fieldName, values);
|
||||||
this.order = order;
|
this.ordinals = ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean multiValued() {
|
@Override public boolean multiValued() {
|
||||||
|
@ -62,11 +62,11 @@ public class MultiValueFloatFieldData extends FloatFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean hasValue(int docId) {
|
@Override public boolean hasValue(int docId) {
|
||||||
return order[docId] != null;
|
return ordinals[docId] != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ public class MultiValueFloatFieldData extends FloatFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ public class MultiValueFloatFieldData extends FloatFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public double[] doubleValues(int docId) {
|
@Override public double[] doubleValues(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ public class MultiValueFloatFieldData extends FloatFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public float value(int docId) {
|
@Override public float value(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ public class MultiValueFloatFieldData extends FloatFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public float[] values(int docId) {
|
@Override public float[] values(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return EMPTY_FLOAT_ARRAY;
|
return EMPTY_FLOAT_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,11 +40,11 @@ public class SingleValueFloatFieldData extends FloatFieldData {
|
||||||
};
|
};
|
||||||
|
|
||||||
// order with value 0 indicates no value
|
// 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);
|
super(fieldName, values);
|
||||||
this.order = order;
|
this.ordinals = ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean multiValued() {
|
@Override public boolean multiValued() {
|
||||||
|
@ -52,11 +52,11 @@ public class SingleValueFloatFieldData extends FloatFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean hasValue(int docId) {
|
@Override public boolean hasValue(int docId) {
|
||||||
return order[docId] != 0;
|
return ordinals[docId] != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ public class SingleValueFloatFieldData extends FloatFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ public class SingleValueFloatFieldData extends FloatFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public double[] doubleValues(int docId) {
|
@Override public double[] doubleValues(int docId) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
||||||
}
|
}
|
||||||
|
@ -82,11 +82,11 @@ public class SingleValueFloatFieldData extends FloatFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public float value(int docId) {
|
@Override public float value(int docId) {
|
||||||
return values[order[docId]];
|
return values[ordinals[docId]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public float[] values(int docId) {
|
@Override public float[] values(int docId) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return EMPTY_FLOAT_ARRAY;
|
return EMPTY_FLOAT_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,12 +121,12 @@ public abstract class IntFieldData extends NumericFieldData<IntDocFieldData> {
|
||||||
terms.add(FieldCache.NUMERIC_UTILS_INT_PARSER.parseInt(term));
|
terms.add(FieldCache.NUMERIC_UTILS_INT_PARSER.parseInt(term));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public IntFieldData buildSingleValue(String field, int[] order) {
|
@Override public IntFieldData buildSingleValue(String field, int[] ordinals) {
|
||||||
return new SingleValueIntFieldData(field, order, terms.toNativeArray());
|
return new SingleValueIntFieldData(field, ordinals, terms.toNativeArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public IntFieldData buildMultiValue(String field, int[][] order) {
|
@Override public IntFieldData buildMultiValue(String field, int[][] ordinals) {
|
||||||
return new MultiValueIntFieldData(field, order, terms.toNativeArray());
|
return new MultiValueIntFieldData(field, ordinals, terms.toNativeArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -50,11 +50,11 @@ public class MultiValueIntFieldData extends IntFieldData {
|
||||||
};
|
};
|
||||||
|
|
||||||
// order with value 0 indicates no value
|
// 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);
|
super(fieldName, values);
|
||||||
this.order = order;
|
this.ordinals = ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean multiValued() {
|
@Override public boolean multiValued() {
|
||||||
|
@ -62,11 +62,11 @@ public class MultiValueIntFieldData extends IntFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean hasValue(int docId) {
|
@Override public boolean hasValue(int docId) {
|
||||||
return order[docId] != null;
|
return ordinals[docId] != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ public class MultiValueIntFieldData extends IntFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ public class MultiValueIntFieldData extends IntFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public double[] doubleValues(int docId) {
|
@Override public double[] doubleValues(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ public class MultiValueIntFieldData extends IntFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public int value(int docId) {
|
@Override public int value(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ public class MultiValueIntFieldData extends IntFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public int[] values(int docId) {
|
@Override public int[] values(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return EMPTY_INT_ARRAY;
|
return EMPTY_INT_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,11 +40,11 @@ public class SingleValueIntFieldData extends IntFieldData {
|
||||||
};
|
};
|
||||||
|
|
||||||
// order with value 0 indicates no value
|
// 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);
|
super(fieldName, values);
|
||||||
this.order = order;
|
this.ordinals = ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean multiValued() {
|
@Override public boolean multiValued() {
|
||||||
|
@ -52,11 +52,11 @@ public class SingleValueIntFieldData extends IntFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean hasValue(int docId) {
|
@Override public boolean hasValue(int docId) {
|
||||||
return order[docId] != 0;
|
return ordinals[docId] != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ public class SingleValueIntFieldData extends IntFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ public class SingleValueIntFieldData extends IntFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public double[] doubleValues(int docId) {
|
@Override public double[] doubleValues(int docId) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
||||||
}
|
}
|
||||||
|
@ -82,11 +82,11 @@ public class SingleValueIntFieldData extends IntFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public int value(int docId) {
|
@Override public int value(int docId) {
|
||||||
return values[order[docId]];
|
return values[ordinals[docId]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public int[] values(int docId) {
|
@Override public int[] values(int docId) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return EMPTY_INT_ARRAY;
|
return EMPTY_INT_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,12 +138,12 @@ public abstract class LongFieldData extends NumericFieldData<LongDocFieldData> {
|
||||||
terms.add(FieldCache.NUMERIC_UTILS_LONG_PARSER.parseLong(term));
|
terms.add(FieldCache.NUMERIC_UTILS_LONG_PARSER.parseLong(term));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public LongFieldData buildSingleValue(String field, int[] order) {
|
@Override public LongFieldData buildSingleValue(String field, int[] ordinals) {
|
||||||
return new SingleValueLongFieldData(field, order, terms.toNativeArray());
|
return new SingleValueLongFieldData(field, ordinals, terms.toNativeArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public LongFieldData buildMultiValue(String field, int[][] order) {
|
@Override public LongFieldData buildMultiValue(String field, int[][] ordinals) {
|
||||||
return new MultiValueLongFieldData(field, order, terms.toNativeArray());
|
return new MultiValueLongFieldData(field, ordinals, terms.toNativeArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -65,11 +65,11 @@ public class MultiValueLongFieldData extends LongFieldData {
|
||||||
};
|
};
|
||||||
|
|
||||||
// order with value 0 indicates no value
|
// 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);
|
super(fieldName, values);
|
||||||
this.order = order;
|
this.ordinals = ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean multiValued() {
|
@Override public boolean multiValued() {
|
||||||
|
@ -77,11 +77,11 @@ public class MultiValueLongFieldData extends LongFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean hasValue(int docId) {
|
@Override public boolean hasValue(int docId) {
|
||||||
return order[docId] != null;
|
return ordinals[docId] != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ public class MultiValueLongFieldData extends LongFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ public class MultiValueLongFieldData extends LongFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public MutableDateTime[] dates(int docId) {
|
@Override public MutableDateTime[] dates(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return EMPTY_DATETIME_ARRAY;
|
return EMPTY_DATETIME_ARRAY;
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ public class MultiValueLongFieldData extends LongFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public double[] doubleValues(int docId) {
|
@Override public double[] doubleValues(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ public class MultiValueLongFieldData extends LongFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public long value(int docId) {
|
@Override public long value(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ public class MultiValueLongFieldData extends LongFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public long[] values(int docId) {
|
@Override public long[] values(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return EMPTY_LONG_ARRAY;
|
return EMPTY_LONG_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,11 +49,11 @@ public class SingleValueLongFieldData extends LongFieldData {
|
||||||
};
|
};
|
||||||
|
|
||||||
// order with value 0 indicates no value
|
// 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);
|
super(fieldName, values);
|
||||||
this.order = order;
|
this.ordinals = ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean multiValued() {
|
@Override public boolean multiValued() {
|
||||||
|
@ -61,11 +61,11 @@ public class SingleValueLongFieldData extends LongFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean hasValue(int docId) {
|
@Override public boolean hasValue(int docId) {
|
||||||
return order[docId] != 0;
|
return ordinals[docId] != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ public class SingleValueLongFieldData extends LongFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ public class SingleValueLongFieldData extends LongFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public MutableDateTime[] dates(int docId) {
|
@Override public MutableDateTime[] dates(int docId) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return EMPTY_DATETIME_ARRAY;
|
return EMPTY_DATETIME_ARRAY;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ public class SingleValueLongFieldData extends LongFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public double[] doubleValues(int docId) {
|
@Override public double[] doubleValues(int docId) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
||||||
}
|
}
|
||||||
|
@ -101,11 +101,11 @@ public class SingleValueLongFieldData extends LongFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public long value(int docId) {
|
@Override public long value(int docId) {
|
||||||
return values[order[docId]];
|
return values[ordinals[docId]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public long[] values(int docId) {
|
@Override public long[] values(int docId) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return EMPTY_LONG_ARRAY;
|
return EMPTY_LONG_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,11 +50,11 @@ public class MultiValueShortFieldData extends ShortFieldData {
|
||||||
};
|
};
|
||||||
|
|
||||||
// order with value 0 indicates no value
|
// 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);
|
super(fieldName, values);
|
||||||
this.order = order;
|
this.ordinals = ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean multiValued() {
|
@Override public boolean multiValued() {
|
||||||
|
@ -62,11 +62,11 @@ public class MultiValueShortFieldData extends ShortFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean hasValue(int docId) {
|
@Override public boolean hasValue(int docId) {
|
||||||
return order[docId] != null;
|
return ordinals[docId] != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ public class MultiValueShortFieldData extends ShortFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ public class MultiValueShortFieldData extends ShortFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public double[] doubleValues(int docId) {
|
@Override public double[] doubleValues(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ public class MultiValueShortFieldData extends ShortFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public short value(int docId) {
|
@Override public short value(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ public class MultiValueShortFieldData extends ShortFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public short[] values(int docId) {
|
@Override public short[] values(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return EMPTY_SHORT_ARRAY;
|
return EMPTY_SHORT_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,12 +121,12 @@ public abstract class ShortFieldData extends NumericFieldData<ShortDocFieldData>
|
||||||
terms.add((short) FieldCache.NUMERIC_UTILS_INT_PARSER.parseInt(term));
|
terms.add((short) FieldCache.NUMERIC_UTILS_INT_PARSER.parseInt(term));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public ShortFieldData buildSingleValue(String field, int[] order) {
|
@Override public ShortFieldData buildSingleValue(String field, int[] ordinals) {
|
||||||
return new SingleValueShortFieldData(field, order, terms.toNativeArray());
|
return new SingleValueShortFieldData(field, ordinals, terms.toNativeArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public ShortFieldData buildMultiValue(String field, int[][] order) {
|
@Override public ShortFieldData buildMultiValue(String field, int[][] ordinals) {
|
||||||
return new MultiValueShortFieldData(field, order, terms.toNativeArray());
|
return new MultiValueShortFieldData(field, ordinals, terms.toNativeArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -40,11 +40,11 @@ public class SingleValueShortFieldData extends ShortFieldData {
|
||||||
};
|
};
|
||||||
|
|
||||||
// order with value 0 indicates no value
|
// 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);
|
super(fieldName, values);
|
||||||
this.order = order;
|
this.ordinals = ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean multiValued() {
|
@Override public boolean multiValued() {
|
||||||
|
@ -52,11 +52,11 @@ public class SingleValueShortFieldData extends ShortFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean hasValue(int docId) {
|
@Override public boolean hasValue(int docId) {
|
||||||
return order[docId] != 0;
|
return ordinals[docId] != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ public class SingleValueShortFieldData extends ShortFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, DoubleValueInDocProc proc) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -72,11 +72,11 @@ public class SingleValueShortFieldData extends ShortFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public short value(int docId) {
|
@Override public short value(int docId) {
|
||||||
return values[order[docId]];
|
return values[ordinals[docId]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public double[] doubleValues(int docId) {
|
@Override public double[] doubleValues(int docId) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
return DoubleFieldData.EMPTY_DOUBLE_ARRAY;
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ public class SingleValueShortFieldData extends ShortFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public short[] values(int docId) {
|
@Override public short[] values(int docId) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return EMPTY_SHORT_ARRAY;
|
return EMPTY_SHORT_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,11 +40,11 @@ public class MultiValueStringFieldData extends StringFieldData {
|
||||||
};
|
};
|
||||||
|
|
||||||
// order with value 0 indicates no value
|
// 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);
|
super(fieldName, values);
|
||||||
this.order = order;
|
this.ordinals = ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean multiValued() {
|
@Override public boolean multiValued() {
|
||||||
|
@ -52,11 +52,11 @@ public class MultiValueStringFieldData extends StringFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean hasValue(int docId) {
|
@Override public boolean hasValue(int docId) {
|
||||||
return order[docId] != null;
|
return ordinals[docId] != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ public class MultiValueStringFieldData extends StringFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public String value(int docId) {
|
@Override public String value(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ public class MultiValueStringFieldData extends StringFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public String[] values(int docId) {
|
@Override public String[] values(int docId) {
|
||||||
int[] docOrders = order[docId];
|
int[] docOrders = ordinals[docId];
|
||||||
if (docOrders == null) {
|
if (docOrders == null) {
|
||||||
return Strings.EMPTY_ARRAY;
|
return Strings.EMPTY_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,15 +34,15 @@ public class SingleValueStringFieldData extends StringFieldData {
|
||||||
};
|
};
|
||||||
|
|
||||||
// order with value 0 indicates no value
|
// 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);
|
super(fieldName, values);
|
||||||
this.order = order;
|
this.ordinals = ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
int[] order() {
|
int[] ordinals() {
|
||||||
return order;
|
return ordinals;
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] values() {
|
String[] values() {
|
||||||
|
@ -54,11 +54,11 @@ public class SingleValueStringFieldData extends StringFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean hasValue(int docId) {
|
@Override public boolean hasValue(int docId) {
|
||||||
return order[docId] != 0;
|
return ordinals[docId] != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
@Override public void forEachValueInDoc(int docId, StringValueInDocProc proc) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -66,11 +66,11 @@ public class SingleValueStringFieldData extends StringFieldData {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public String value(int docId) {
|
@Override public String value(int docId) {
|
||||||
return values[order[docId]];
|
return values[ordinals[docId]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public String[] values(int docId) {
|
@Override public String[] values(int docId) {
|
||||||
int loc = order[docId];
|
int loc = ordinals[docId];
|
||||||
if (loc == 0) {
|
if (loc == 0) {
|
||||||
return Strings.EMPTY_ARRAY;
|
return Strings.EMPTY_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,12 +83,12 @@ public abstract class StringFieldData extends FieldData<StringDocFieldData> {
|
||||||
terms.add(term);
|
terms.add(term);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public StringFieldData buildSingleValue(String field, int[] order) {
|
@Override public StringFieldData buildSingleValue(String field, int[] ordinals) {
|
||||||
return new SingleValueStringFieldData(field, order, terms.toArray(new String[terms.size()]));
|
return new SingleValueStringFieldData(field, ordinals, terms.toArray(new String[terms.size()]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public StringFieldData buildMultiValue(String field, int[][] order) {
|
@Override public StringFieldData buildMultiValue(String field, int[][] ordinals) {
|
||||||
return new MultiValueStringFieldData(field, order, terms.toArray(new String[terms.size()]));
|
return new MultiValueStringFieldData(field, ordinals, terms.toArray(new String[terms.size()]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class StringOrdValFieldDataComparator extends FieldComparator {
|
||||||
}
|
}
|
||||||
SingleValueStringFieldData fieldData = (SingleValueStringFieldData) cleanFieldData;
|
SingleValueStringFieldData fieldData = (SingleValueStringFieldData) cleanFieldData;
|
||||||
currentReaderGen++;
|
currentReaderGen++;
|
||||||
order = fieldData.order();
|
order = fieldData.ordinals();
|
||||||
lookup = fieldData.values();
|
lookup = fieldData.values();
|
||||||
assert lookup.length > 0;
|
assert lookup.length > 0;
|
||||||
if (bottomSlot != -1) {
|
if (bottomSlot != -1) {
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class FieldDataLoader {
|
||||||
loader.init();
|
loader.init();
|
||||||
|
|
||||||
field = StringHelper.intern(field);
|
field = StringHelper.intern(field);
|
||||||
int[][] orders = new int[reader.maxDoc()][];
|
int[][] ordinals = new int[reader.maxDoc()][];
|
||||||
|
|
||||||
int t = 1; // current term number
|
int t = 1; // current term number
|
||||||
|
|
||||||
|
@ -55,16 +55,16 @@ public class FieldDataLoader {
|
||||||
termDocs.seek(termEnum);
|
termDocs.seek(termEnum);
|
||||||
while (termDocs.next()) {
|
while (termDocs.next()) {
|
||||||
int doc = termDocs.doc();
|
int doc = termDocs.doc();
|
||||||
int[] orderPerDoc = orders[doc];
|
int[] ordinalPerDoc = ordinals[doc];
|
||||||
if (orderPerDoc == null) {
|
if (ordinalPerDoc == null) {
|
||||||
orderPerDoc = new int[1];
|
ordinalPerDoc = new int[1];
|
||||||
orderPerDoc[0] = t;
|
ordinalPerDoc[0] = t;
|
||||||
orders[doc] = orderPerDoc;
|
ordinals[doc] = ordinalPerDoc;
|
||||||
} else {
|
} else {
|
||||||
multiValued = true;
|
multiValued = true;
|
||||||
orderPerDoc = Arrays.copyOf(orderPerDoc, orderPerDoc.length + 1);
|
ordinalPerDoc = Arrays.copyOf(ordinalPerDoc, ordinalPerDoc.length + 1);
|
||||||
orderPerDoc[orderPerDoc.length - 1] = t;
|
ordinalPerDoc[ordinalPerDoc.length - 1] = t;
|
||||||
orders[doc] = orderPerDoc;
|
ordinals[doc] = ordinalPerDoc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,13 +82,13 @@ public class FieldDataLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multiValued) {
|
if (multiValued) {
|
||||||
return loader.buildMultiValue(field, orders);
|
return loader.buildMultiValue(field, ordinals);
|
||||||
} else {
|
} else {
|
||||||
// optimize for a single valued
|
// optimize for a single valued
|
||||||
int[] sOrders = new int[reader.maxDoc()];
|
int[] sOrders = new int[reader.maxDoc()];
|
||||||
for (int i = 0; i < orders.length; i++) {
|
for (int i = 0; i < ordinals.length; i++) {
|
||||||
if (orders[i] != null) {
|
if (ordinals[i] != null) {
|
||||||
sOrders[i] = orders[i][0];
|
sOrders[i] = ordinals[i][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return loader.buildSingleValue(field, sOrders);
|
return loader.buildSingleValue(field, sOrders);
|
||||||
|
@ -101,9 +101,9 @@ public class FieldDataLoader {
|
||||||
|
|
||||||
void collectTerm(String term);
|
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<T extends FieldData> implements TypeLoader<T> {
|
public static abstract class FreqsTypeLoader<T extends FieldData> implements TypeLoader<T> {
|
||||||
|
|
|
@ -130,12 +130,12 @@ public abstract class GeoPointFieldData extends FieldData<GeoPointDocFieldData>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public GeoPointFieldData buildSingleValue(String field, int[] order) {
|
@Override public GeoPointFieldData buildSingleValue(String field, int[] ordinals) {
|
||||||
return new SingleValueGeoPointFieldData(field, order, lat.toNativeArray(), lon.toNativeArray());
|
return new SingleValueGeoPointFieldData(field, ordinals, lat.toNativeArray(), lon.toNativeArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public GeoPointFieldData buildMultiValue(String field, int[][] order) {
|
@Override public GeoPointFieldData buildMultiValue(String field, int[][] ordinals) {
|
||||||
return new MultiValueGeoPointFieldData(field, order, lat.toNativeArray(), lon.toNativeArray());
|
return new MultiValueGeoPointFieldData(field, ordinals, lat.toNativeArray(), lon.toNativeArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue