lucene 4: fix numeric types to properly return numeric streams
This commit is contained in:
parent
a38064913f
commit
a10f60873c
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.index.mapper.core;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.TokenStream;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.document.FieldType;
|
||||
|
@ -61,6 +62,7 @@ public class DoubleFieldMapper extends NumberFieldMapper<Double> {
|
|||
static {
|
||||
DOUBLE_FIELD_TYPE.freeze();
|
||||
}
|
||||
|
||||
public static final Double NULL_VALUE = null;
|
||||
}
|
||||
|
||||
|
@ -375,7 +377,7 @@ public class DoubleFieldMapper extends NumberFieldMapper<Double> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TokenStream tokenStreamValue() {
|
||||
public TokenStream tokenStream(Analyzer analyzer) throws IOException {
|
||||
if (fieldType().indexed()) {
|
||||
return mapper.popCachedStream().setDoubleValue(number);
|
||||
}
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
|
||||
package org.elasticsearch.index.mapper.core;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.TokenStream;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.document.FieldType;
|
||||
import org.apache.lucene.index.FieldInfo.IndexOptions;
|
||||
import org.apache.lucene.search.Filter;
|
||||
import org.apache.lucene.search.NumericRangeFilter;
|
||||
import org.apache.lucene.search.NumericRangeQuery;
|
||||
|
@ -373,7 +373,7 @@ public class FloatFieldMapper extends NumberFieldMapper<Float> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TokenStream tokenStreamValue() {
|
||||
public TokenStream tokenStream(Analyzer analyzer) throws IOException {
|
||||
if (fieldType().indexed()) {
|
||||
return mapper.popCachedStream().setFloatValue(number);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.index.mapper.core;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.TokenStream;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.document.FieldType;
|
||||
|
@ -376,7 +377,7 @@ public class IntegerFieldMapper extends NumberFieldMapper<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TokenStream tokenStreamValue() {
|
||||
public TokenStream tokenStream(Analyzer analyzer) throws IOException {
|
||||
if (fieldType().indexed()) {
|
||||
return mapper.popCachedStream().setIntValue(number);
|
||||
}
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
|
||||
package org.elasticsearch.index.mapper.core;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.TokenStream;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.document.FieldType;
|
||||
import org.apache.lucene.index.FieldInfo.IndexOptions;
|
||||
import org.apache.lucene.search.Filter;
|
||||
import org.apache.lucene.search.NumericRangeFilter;
|
||||
import org.apache.lucene.search.NumericRangeQuery;
|
||||
|
@ -376,7 +376,7 @@ public class LongFieldMapper extends NumberFieldMapper<Long> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TokenStream tokenStreamValue() {
|
||||
public TokenStream tokenStream(Analyzer analyzer) throws IOException {
|
||||
if (fieldType().indexed()) {
|
||||
return mapper.popCachedStream().setLongValue(number);
|
||||
}
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
|
||||
package org.elasticsearch.index.mapper.core;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.TokenStream;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.document.FieldType;
|
||||
import org.apache.lucene.index.FieldInfo.IndexOptions;
|
||||
import org.apache.lucene.search.Filter;
|
||||
import org.apache.lucene.search.NumericRangeFilter;
|
||||
import org.apache.lucene.search.NumericRangeQuery;
|
||||
|
@ -63,6 +63,7 @@ public class ShortFieldMapper extends NumberFieldMapper<Short> {
|
|||
static {
|
||||
SHORT_FIELD_TYPE.freeze();
|
||||
}
|
||||
|
||||
public static final Short NULL_VALUE = null;
|
||||
}
|
||||
|
||||
|
@ -375,7 +376,7 @@ public class ShortFieldMapper extends NumberFieldMapper<Short> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TokenStream tokenStreamValue() {
|
||||
public TokenStream tokenStream(Analyzer analyzer) throws IOException {
|
||||
if (fieldType().indexed()) {
|
||||
return mapper.popCachedStream().setIntValue(number);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue