lucene 4: fix numeric types to properly return numeric streams

This commit is contained in:
Shay Banon 2012-11-03 23:00:15 +01:00
parent a38064913f
commit a10f60873c
5 changed files with 12 additions and 8 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}