rename analyzed to tokenized to match field type

This commit is contained in:
Shay Banon 2012-12-18 11:34:41 -08:00
parent b9c5f0472c
commit f3dbe9224a
12 changed files with 24 additions and 24 deletions

View File

@ -122,7 +122,7 @@ public interface FieldMapper<T> {
boolean indexed();
boolean analyzed();
boolean tokenized();
boolean stored();

View File

@ -319,7 +319,7 @@ public abstract class AbstractFieldMapper<T> implements FieldMapper<T>, Mapper {
}
@Override
public boolean analyzed() {
public boolean tokenized() {
return fieldType.tokenized();
}
@ -524,13 +524,13 @@ public abstract class AbstractFieldMapper<T> implements FieldMapper<T>, Mapper {
return;
}
AbstractFieldMapper fieldMergeWith = (AbstractFieldMapper) mergeWith;
if (this.indexed() != fieldMergeWith.indexed() || this.analyzed() != fieldMergeWith.analyzed()) {
if (this.indexed() != fieldMergeWith.indexed() || this.tokenized() != fieldMergeWith.tokenized()) {
mergeContext.addConflict("mapper [" + names.fullName() + "] has different index values");
}
if (this.stored() != fieldMergeWith.stored()) {
mergeContext.addConflict("mapper [" + names.fullName() + "] has different store values");
}
if (this.analyzed() != fieldMergeWith.analyzed()) {
if (this.tokenized() != fieldMergeWith.tokenized()) {
mergeContext.addConflict("mapper [" + names.fullName() + "] has different tokenize values");
}
if (this.storeTermVectors() != fieldMergeWith.storeTermVectors()) {

View File

@ -225,8 +225,8 @@ public class BooleanFieldMapper extends AbstractFieldMapper<Boolean> {
protected void doXContentBody(XContentBuilder builder) throws IOException {
super.doXContentBody(builder);
if (indexed() != Defaults.BOOLEAN_FIELD_TYPE.indexed() ||
analyzed() != Defaults.BOOLEAN_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), analyzed()));
tokenized() != Defaults.BOOLEAN_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), tokenized()));
}
if (stored() != Defaults.BOOLEAN_FIELD_TYPE.stored()) {
builder.field("store", stored());

View File

@ -329,8 +329,8 @@ public class ByteFieldMapper extends NumberFieldMapper<Byte> {
protected void doXContentBody(XContentBuilder builder) throws IOException {
super.doXContentBody(builder);
if (indexed() != Defaults.BYTE_FIELD_TYPE.indexed() ||
analyzed() != Defaults.BYTE_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), analyzed()));
tokenized() != Defaults.BYTE_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), tokenized()));
}
if (stored() != Defaults.BYTE_FIELD_TYPE.stored()) {
builder.field("store", stored());

View File

@ -403,8 +403,8 @@ public class DateFieldMapper extends NumberFieldMapper<Long> {
protected void doXContentBody(XContentBuilder builder) throws IOException {
super.doXContentBody(builder);
if (indexed() != Defaults.DATE_FIELD_TYPE.indexed() ||
analyzed() != Defaults.DATE_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), analyzed()));
tokenized() != Defaults.DATE_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), tokenized()));
}
if (stored() != Defaults.DATE_FIELD_TYPE.stored()) {
builder.field("store", stored());

View File

@ -332,8 +332,8 @@ public class DoubleFieldMapper extends NumberFieldMapper<Double> {
protected void doXContentBody(XContentBuilder builder) throws IOException {
super.doXContentBody(builder);
if (indexed() != Defaults.DOUBLE_FIELD_TYPE.indexed() ||
analyzed() != Defaults.DOUBLE_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), analyzed()));
tokenized() != Defaults.DOUBLE_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), tokenized()));
}
if (stored() != Defaults.DOUBLE_FIELD_TYPE.stored()) {
builder.field("store", stored());

View File

@ -327,8 +327,8 @@ public class FloatFieldMapper extends NumberFieldMapper<Float> {
protected void doXContentBody(XContentBuilder builder) throws IOException {
super.doXContentBody(builder);
if (indexed() != Defaults.FLOAT_FIELD_TYPE.indexed() ||
analyzed() != Defaults.FLOAT_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), analyzed()));
tokenized() != Defaults.FLOAT_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), tokenized()));
}
if (stored() != Defaults.FLOAT_FIELD_TYPE.stored()) {
builder.field("store", stored());

View File

@ -332,8 +332,8 @@ public class IntegerFieldMapper extends NumberFieldMapper<Integer> {
protected void doXContentBody(XContentBuilder builder) throws IOException {
super.doXContentBody(builder);
if (indexed() != Defaults.INTEGER_FIELD_TYPE.indexed() ||
analyzed() != Defaults.INTEGER_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), analyzed()));
tokenized() != Defaults.INTEGER_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), tokenized()));
}
if (stored() != Defaults.INTEGER_FIELD_TYPE.stored()) {
builder.field("store", stored());

View File

@ -331,8 +331,8 @@ public class LongFieldMapper extends NumberFieldMapper<Long> {
protected void doXContentBody(XContentBuilder builder) throws IOException {
super.doXContentBody(builder);
if (indexed() != Defaults.LONG_FIELD_TYPE.indexed() ||
analyzed() != Defaults.LONG_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), analyzed()));
tokenized() != Defaults.LONG_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), tokenized()));
}
if (stored() != Defaults.LONG_FIELD_TYPE.stored()) {
builder.field("store", stored());

View File

@ -331,8 +331,8 @@ public class ShortFieldMapper extends NumberFieldMapper<Short> {
protected void doXContentBody(XContentBuilder builder) throws IOException {
super.doXContentBody(builder);
if (indexed() != Defaults.SHORT_FIELD_TYPE.indexed() ||
analyzed() != Defaults.SHORT_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), analyzed()));
tokenized() != Defaults.SHORT_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), tokenized()));
}
if (stored() != Defaults.SHORT_FIELD_TYPE.stored()) {
builder.field("store", stored());

View File

@ -319,8 +319,8 @@ public class StringFieldMapper extends AbstractFieldMapper<String> implements Al
protected void doXContentBody(XContentBuilder builder) throws IOException {
super.doXContentBody(builder);
if (indexed() != Defaults.STRING_FIELD_TYPE.indexed() ||
analyzed() != Defaults.STRING_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), analyzed()));
tokenized() != Defaults.STRING_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), tokenized()));
}
if (stored() != Defaults.STRING_FIELD_TYPE.stored()) {
builder.field("store", stored());

View File

@ -306,8 +306,8 @@ public class IpFieldMapper extends NumberFieldMapper<Long> {
protected void doXContentBody(XContentBuilder builder) throws IOException {
super.doXContentBody(builder);
if (indexed() != Defaults.IP_FIELD_TYPE.indexed() ||
analyzed() != Defaults.IP_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), analyzed()));
tokenized() != Defaults.IP_FIELD_TYPE.tokenized()) {
builder.field("index", indexTokenizeOptionToString(indexed(), tokenized()));
}
if (stored() != Defaults.IP_FIELD_TYPE.stored()) {
builder.field("store", stored());