Version: Set version to 5.0.0-alpha2

This commit is contained in:
Alexander Reelsen 2016-04-26 09:30:26 +02:00
parent 66686040ca
commit f71eb0b888
23 changed files with 32 additions and 56 deletions

View File

@ -1,4 +1,4 @@
elasticsearch = 5.0.0 elasticsearch = 5.0.0-alpha2
lucene = 6.0.0 lucene = 6.0.0
# optional dependencies # optional dependencies

View File

@ -70,9 +70,9 @@ public class Version {
public static final Version V_2_3_1 = new Version(V_2_3_1_ID, org.apache.lucene.util.Version.LUCENE_5_5_0); public static final Version V_2_3_1 = new Version(V_2_3_1_ID, org.apache.lucene.util.Version.LUCENE_5_5_0);
public static final int V_5_0_0_alpha1_ID = 5000001; public static final int V_5_0_0_alpha1_ID = 5000001;
public static final Version V_5_0_0_alpha1 = new Version(V_5_0_0_alpha1_ID, org.apache.lucene.util.Version.LUCENE_6_0_0); public static final Version V_5_0_0_alpha1 = new Version(V_5_0_0_alpha1_ID, org.apache.lucene.util.Version.LUCENE_6_0_0);
public static final int V_5_0_0_ID = 5000099; public static final int V_5_0_0_alpha2_ID = 5000002;
public static final Version V_5_0_0 = new Version(V_5_0_0_ID, org.apache.lucene.util.Version.LUCENE_6_0_0); public static final Version V_5_0_0_alpha2 = new Version(V_5_0_0_alpha2_ID, org.apache.lucene.util.Version.LUCENE_6_0_0);
public static final Version CURRENT = V_5_0_0; public static final Version CURRENT = V_5_0_0_alpha2;
static { static {
assert CURRENT.luceneVersion.equals(org.apache.lucene.util.Version.LATEST) : "Version must be upgraded to [" assert CURRENT.luceneVersion.equals(org.apache.lucene.util.Version.LATEST) : "Version must be upgraded to ["
@ -85,8 +85,8 @@ public class Version {
public static Version fromId(int id) { public static Version fromId(int id) {
switch (id) { switch (id) {
case V_5_0_0_ID: case V_5_0_0_alpha2_ID:
return V_5_0_0; return V_5_0_0_alpha2;
case V_5_0_0_alpha1_ID: case V_5_0_0_alpha1_ID:
return V_5_0_0_alpha1; return V_5_0_0_alpha1;
case V_2_3_1_ID: case V_2_3_1_ID:

View File

@ -40,12 +40,9 @@ import org.elasticsearch.index.mapper.core.DateFieldMapper;
import org.elasticsearch.index.mapper.core.KeywordFieldMapper; import org.elasticsearch.index.mapper.core.KeywordFieldMapper;
import org.elasticsearch.index.mapper.core.KeywordFieldMapper.KeywordFieldType; import org.elasticsearch.index.mapper.core.KeywordFieldMapper.KeywordFieldType;
import org.elasticsearch.index.mapper.core.LegacyDateFieldMapper; import org.elasticsearch.index.mapper.core.LegacyDateFieldMapper;
import org.elasticsearch.index.mapper.core.LegacyDoubleFieldMapper;
import org.elasticsearch.index.mapper.core.LegacyFloatFieldMapper; import org.elasticsearch.index.mapper.core.LegacyFloatFieldMapper;
import org.elasticsearch.index.mapper.core.LegacyIntegerFieldMapper;
import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper; import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper;
import org.elasticsearch.index.mapper.core.NumberFieldMapper; import org.elasticsearch.index.mapper.core.NumberFieldMapper;
import org.elasticsearch.index.mapper.core.StringFieldMapper;
import org.elasticsearch.index.mapper.core.StringFieldMapper.StringFieldType; import org.elasticsearch.index.mapper.core.StringFieldMapper.StringFieldType;
import org.elasticsearch.index.mapper.core.TextFieldMapper; import org.elasticsearch.index.mapper.core.TextFieldMapper;
import org.elasticsearch.index.mapper.core.TextFieldMapper.TextFieldType; import org.elasticsearch.index.mapper.core.TextFieldMapper.TextFieldType;
@ -639,7 +636,7 @@ final class DocumentParser {
} }
private static Mapper.Builder<?, ?> newLongBuilder(String name, Version indexCreated) { private static Mapper.Builder<?, ?> newLongBuilder(String name, Version indexCreated) {
if (indexCreated.onOrAfter(Version.V_5_0_0)) { if (indexCreated.onOrAfter(Version.V_5_0_0_alpha2)) {
return new NumberFieldMapper.Builder(name, NumberFieldMapper.NumberType.LONG); return new NumberFieldMapper.Builder(name, NumberFieldMapper.NumberType.LONG);
} else { } else {
return new LegacyLongFieldMapper.Builder(name); return new LegacyLongFieldMapper.Builder(name);
@ -647,7 +644,7 @@ final class DocumentParser {
} }
private static Mapper.Builder<?, ?> newFloatBuilder(String name, Version indexCreated) { private static Mapper.Builder<?, ?> newFloatBuilder(String name, Version indexCreated) {
if (indexCreated.onOrAfter(Version.V_5_0_0)) { if (indexCreated.onOrAfter(Version.V_5_0_0_alpha2)) {
return new NumberFieldMapper.Builder(name, NumberFieldMapper.NumberType.FLOAT); return new NumberFieldMapper.Builder(name, NumberFieldMapper.NumberType.FLOAT);
} else { } else {
return new LegacyFloatFieldMapper.Builder(name); return new LegacyFloatFieldMapper.Builder(name);
@ -655,7 +652,7 @@ final class DocumentParser {
} }
private static Mapper.Builder<?, ?> newDateBuilder(String name, FormatDateTimeFormatter dateTimeFormatter, Version indexCreated) { private static Mapper.Builder<?, ?> newDateBuilder(String name, FormatDateTimeFormatter dateTimeFormatter, Version indexCreated) {
if (indexCreated.onOrAfter(Version.V_5_0_0)) { if (indexCreated.onOrAfter(Version.V_5_0_0_alpha2)) {
DateFieldMapper.Builder builder = new DateFieldMapper.Builder(name); DateFieldMapper.Builder builder = new DateFieldMapper.Builder(name);
if (dateTimeFormatter != null) { if (dateTimeFormatter != null) {
builder.dateTimeFormatter(dateTimeFormatter); builder.dateTimeFormatter(dateTimeFormatter);

View File

@ -139,7 +139,7 @@ public class DateFieldMapper extends FieldMapper implements AllFieldMapper.Inclu
@Override @Override
public Mapper.Builder<?,?> parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException { public Mapper.Builder<?,?> parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException {
if (parserContext.indexVersionCreated().before(Version.V_5_0_0)) { if (parserContext.indexVersionCreated().before(Version.V_5_0_0_alpha2)) {
return new LegacyDateFieldMapper.TypeParser().parse(name, node, parserContext); return new LegacyDateFieldMapper.TypeParser().parse(name, node, parserContext);
} }
Builder builder = new Builder(name); Builder builder = new Builder(name);

View File

@ -32,12 +32,10 @@ import org.apache.lucene.util.LegacyNumericUtils;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.action.fieldstats.FieldStats; import org.elasticsearch.action.fieldstats.FieldStats;
import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.unit.Fuzziness;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.analysis.NamedAnalyzer;
import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldData;
import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType;
import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData;
@ -78,7 +76,7 @@ public class LegacyByteFieldMapper extends LegacyNumberFieldMapper {
@Override @Override
public LegacyByteFieldMapper build(BuilderContext context) { public LegacyByteFieldMapper build(BuilderContext context) {
if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0)) { if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0_alpha2)) {
throw new IllegalStateException("Cannot use legacy numeric types after 5.0"); throw new IllegalStateException("Cannot use legacy numeric types after 5.0");
} }
setupFieldType(context); setupFieldType(context);

View File

@ -32,7 +32,6 @@ import org.elasticsearch.Version;
import org.elasticsearch.action.fieldstats.FieldStats; import org.elasticsearch.action.fieldstats.FieldStats;
import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.joda.DateMathParser; import org.elasticsearch.common.joda.DateMathParser;
import org.elasticsearch.common.joda.FormatDateTimeFormatter; import org.elasticsearch.common.joda.FormatDateTimeFormatter;
import org.elasticsearch.common.joda.Joda; import org.elasticsearch.common.joda.Joda;
@ -116,7 +115,7 @@ public class LegacyDateFieldMapper extends LegacyNumberFieldMapper {
@Override @Override
public LegacyDateFieldMapper build(BuilderContext context) { public LegacyDateFieldMapper build(BuilderContext context) {
if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0)) { if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0_alpha2)) {
throw new IllegalStateException("Cannot use legacy numeric types after 5.0"); throw new IllegalStateException("Cannot use legacy numeric types after 5.0");
} }
setupFieldType(context); setupFieldType(context);

View File

@ -39,7 +39,6 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.unit.Fuzziness;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.analysis.NamedAnalyzer;
import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldData;
import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType;
import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData;
@ -80,7 +79,7 @@ public class LegacyDoubleFieldMapper extends LegacyNumberFieldMapper {
@Override @Override
public LegacyDoubleFieldMapper build(BuilderContext context) { public LegacyDoubleFieldMapper build(BuilderContext context) {
if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0)) { if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0_alpha2)) {
throw new IllegalStateException("Cannot use legacy numeric types after 5.0"); throw new IllegalStateException("Cannot use legacy numeric types after 5.0");
} }
setupFieldType(context); setupFieldType(context);

View File

@ -34,7 +34,6 @@ import org.apache.lucene.util.NumericUtils;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.action.fieldstats.FieldStats; import org.elasticsearch.action.fieldstats.FieldStats;
import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.unit.Fuzziness;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
@ -79,7 +78,7 @@ public class LegacyFloatFieldMapper extends LegacyNumberFieldMapper {
@Override @Override
public LegacyFloatFieldMapper build(BuilderContext context) { public LegacyFloatFieldMapper build(BuilderContext context) {
if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0)) { if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0_alpha2)) {
throw new IllegalStateException("Cannot use legacy numeric types after 5.0"); throw new IllegalStateException("Cannot use legacy numeric types after 5.0");
} }
setupFieldType(context); setupFieldType(context);

View File

@ -33,13 +33,10 @@ import org.apache.lucene.util.LegacyNumericUtils;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.action.fieldstats.FieldStats; import org.elasticsearch.action.fieldstats.FieldStats;
import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.Numbers;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.unit.Fuzziness;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.analysis.NamedAnalyzer;
import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldData;
import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType;
import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData;
@ -85,7 +82,7 @@ public class LegacyIntegerFieldMapper extends LegacyNumberFieldMapper {
@Override @Override
public LegacyIntegerFieldMapper build(BuilderContext context) { public LegacyIntegerFieldMapper build(BuilderContext context) {
if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0)) { if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0_alpha2)) {
throw new IllegalStateException("Cannot use legacy numeric types after 5.0"); throw new IllegalStateException("Cannot use legacy numeric types after 5.0");
} }
setupFieldType(context); setupFieldType(context);

View File

@ -33,13 +33,10 @@ import org.apache.lucene.util.LegacyNumericUtils;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.action.fieldstats.FieldStats; import org.elasticsearch.action.fieldstats.FieldStats;
import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.Numbers;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.unit.Fuzziness;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.analysis.NamedAnalyzer;
import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldData;
import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType;
import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData;
@ -85,7 +82,7 @@ public class LegacyLongFieldMapper extends LegacyNumberFieldMapper {
@Override @Override
public LegacyLongFieldMapper build(BuilderContext context) { public LegacyLongFieldMapper build(BuilderContext context) {
if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0)) { if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0_alpha2)) {
throw new IllegalStateException("Cannot use legacy numeric types after 5.0"); throw new IllegalStateException("Cannot use legacy numeric types after 5.0");
} }
setupFieldType(context); setupFieldType(context);

View File

@ -33,12 +33,10 @@ import org.apache.lucene.util.LegacyNumericUtils;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.action.fieldstats.FieldStats; import org.elasticsearch.action.fieldstats.FieldStats;
import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.unit.Fuzziness;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.analysis.NamedAnalyzer;
import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldData;
import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType;
import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData;
@ -80,7 +78,7 @@ public class LegacyShortFieldMapper extends LegacyNumberFieldMapper {
@Override @Override
public LegacyShortFieldMapper build(BuilderContext context) { public LegacyShortFieldMapper build(BuilderContext context) {
if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0)) { if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0_alpha2)) {
throw new IllegalStateException("Cannot use legacy numeric types after 5.0"); throw new IllegalStateException("Cannot use legacy numeric types after 5.0");
} }
setupFieldType(context); setupFieldType(context);

View File

@ -25,7 +25,6 @@ import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.analysis.NamedAnalyzer;
@ -75,7 +74,7 @@ public class LegacyTokenCountFieldMapper extends LegacyIntegerFieldMapper {
@Override @Override
public LegacyTokenCountFieldMapper build(BuilderContext context) { public LegacyTokenCountFieldMapper build(BuilderContext context) {
if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0)) { if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0_alpha2)) {
throw new IllegalStateException("Cannot use legacy numeric types after 5.0"); throw new IllegalStateException("Cannot use legacy numeric types after 5.0");
} }
setupFieldType(context); setupFieldType(context);

View File

@ -136,7 +136,7 @@ public class NumberFieldMapper extends FieldMapper implements AllFieldMapper.Inc
@Override @Override
public Mapper.Builder<?,?> parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException { public Mapper.Builder<?,?> parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException {
if (parserContext.indexVersionCreated().before(Version.V_5_0_0)) { if (parserContext.indexVersionCreated().before(Version.V_5_0_0_alpha2)) {
switch (type) { switch (type) {
case BYTE: case BYTE:
return new LegacyByteFieldMapper.TypeParser().parse(name, node, parserContext); return new LegacyByteFieldMapper.TypeParser().parse(name, node, parserContext);

View File

@ -25,7 +25,6 @@ import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexOptions;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.analysis.NamedAnalyzer;
@ -83,7 +82,7 @@ public class TokenCountFieldMapper extends FieldMapper {
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public Mapper.Builder parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException { public Mapper.Builder parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException {
if (parserContext.indexVersionCreated().before(Version.V_5_0_0)) { if (parserContext.indexVersionCreated().before(Version.V_5_0_0_alpha2)) {
return new LegacyTokenCountFieldMapper.TypeParser().parse(name, node, parserContext); return new LegacyTokenCountFieldMapper.TypeParser().parse(name, node, parserContext);
} }
TokenCountFieldMapper.Builder builder = new TokenCountFieldMapper.Builder(name); TokenCountFieldMapper.Builder builder = new TokenCountFieldMapper.Builder(name);

View File

@ -26,7 +26,6 @@ import org.elasticsearch.Version;
import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.collect.Iterators; import org.elasticsearch.common.collect.Iterators;
import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.common.geo.GeoUtils;
@ -157,7 +156,7 @@ public abstract class BaseGeoPointFieldMapper extends FieldMapper implements Arr
context.path().add(name); context.path().add(name);
if (enableLatLon) { if (enableLatLon) {
if (context.indexCreatedVersion().before(Version.V_5_0_0)) { if (context.indexCreatedVersion().before(Version.V_5_0_0_alpha2)) {
LegacyNumberFieldMapper.Builder<?, ?> latMapperBuilder = new LegacyDoubleFieldMapper.Builder(Names.LAT).includeInAll(false); LegacyNumberFieldMapper.Builder<?, ?> latMapperBuilder = new LegacyDoubleFieldMapper.Builder(Names.LAT).includeInAll(false);
LegacyNumberFieldMapper.Builder<?, ?> lonMapperBuilder = new LegacyDoubleFieldMapper.Builder(Names.LON).includeInAll(false); LegacyNumberFieldMapper.Builder<?, ?> lonMapperBuilder = new LegacyDoubleFieldMapper.Builder(Names.LON).includeInAll(false);
if (precisionStep != null) { if (precisionStep != null) {

View File

@ -48,14 +48,12 @@ import org.elasticsearch.index.mapper.ParseContext;
import org.elasticsearch.index.mapper.core.LegacyNumberFieldMapper.Defaults; import org.elasticsearch.index.mapper.core.LegacyNumberFieldMapper.Defaults;
import org.elasticsearch.index.mapper.core.TypeParsers; import org.elasticsearch.index.mapper.core.TypeParsers;
import org.elasticsearch.index.mapper.internal.AllFieldMapper; import org.elasticsearch.index.mapper.internal.AllFieldMapper;
import org.elasticsearch.index.mapper.ip.LegacyIpFieldMapper;
import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.DocValueFormat;
import org.joda.time.DateTimeZone; import org.joda.time.DateTimeZone;
import java.io.IOException; import java.io.IOException;
import java.net.InetAddress; import java.net.InetAddress;
import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -105,7 +103,7 @@ public class IpFieldMapper extends FieldMapper implements AllFieldMapper.Include
@Override @Override
public Mapper.Builder<?,?> parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException { public Mapper.Builder<?,?> parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException {
if (parserContext.indexVersionCreated().before(Version.V_5_0_0)) { if (parserContext.indexVersionCreated().before(Version.V_5_0_0_alpha2)) {
return new LegacyIpFieldMapper.TypeParser().parse(name, node, parserContext); return new LegacyIpFieldMapper.TypeParser().parse(name, node, parserContext);
} }
Builder builder = new Builder(name); Builder builder = new Builder(name);

View File

@ -19,7 +19,6 @@
package org.elasticsearch.index.mapper.ip; package org.elasticsearch.index.mapper.ip;
import org.apache.lucene.analysis.LegacyNumericTokenStream;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexOptions;
import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexReader;
@ -33,7 +32,6 @@ import org.elasticsearch.Version;
import org.elasticsearch.action.fieldstats.FieldStats; import org.elasticsearch.action.fieldstats.FieldStats;
import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.network.Cidrs; import org.elasticsearch.common.network.Cidrs;
import org.elasticsearch.common.network.InetAddresses; import org.elasticsearch.common.network.InetAddresses;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
@ -122,7 +120,7 @@ public class LegacyIpFieldMapper extends LegacyNumberFieldMapper {
@Override @Override
public LegacyIpFieldMapper build(BuilderContext context) { public LegacyIpFieldMapper build(BuilderContext context) {
if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0)) { if (context.indexCreatedVersion().onOrAfter(Version.V_5_0_0_alpha2)) {
throw new IllegalStateException("Cannot use legacy numeric types after 5.0"); throw new IllegalStateException("Cannot use legacy numeric types after 5.0");
} }
setupFieldType(context); setupFieldType(context);

View File

@ -429,7 +429,7 @@ public class GeoPointFieldMapperTests extends ESSingleNodeTestCase {
.endObject() .endObject()
.bytes()); .bytes());
if (version.onOrAfter(Version.V_5_0_0)) { if (version.onOrAfter(Version.V_5_0_0_alpha2)) {
assertThat(doc.rootDoc().getFields("point.lat").length, equalTo(4)); assertThat(doc.rootDoc().getFields("point.lat").length, equalTo(4));
assertThat(doc.rootDoc().getFields("point.lon").length, equalTo(4)); assertThat(doc.rootDoc().getFields("point.lon").length, equalTo(4));
@ -538,7 +538,7 @@ public class GeoPointFieldMapperTests extends ESSingleNodeTestCase {
.endObject() .endObject()
.bytes()); .bytes());
if (version.before(Version.V_5_0_0)) { if (version.before(Version.V_5_0_0_alpha2)) {
assertThat(doc.rootDoc().getFields("point.lat").length, equalTo(2)); assertThat(doc.rootDoc().getFields("point.lat").length, equalTo(2));
assertThat(doc.rootDoc().getFields("point.lon").length, equalTo(2)); assertThat(doc.rootDoc().getFields("point.lon").length, equalTo(2));
assertThat(doc.rootDoc().getFields("point.lat")[0].numericValue().doubleValue(), equalTo(1.2)); assertThat(doc.rootDoc().getFields("point.lat")[0].numericValue().doubleValue(), equalTo(1.2));
@ -660,7 +660,7 @@ public class GeoPointFieldMapperTests extends ESSingleNodeTestCase {
.endObject() .endObject()
.bytes()); .bytes());
if (version.before(Version.V_5_0_0)) { if (version.before(Version.V_5_0_0_alpha2)) {
assertThat(doc.rootDoc().getFields("point.lat").length, equalTo(2)); assertThat(doc.rootDoc().getFields("point.lat").length, equalTo(2));
assertThat(doc.rootDoc().getFields("point.lon").length, equalTo(2)); assertThat(doc.rootDoc().getFields("point.lon").length, equalTo(2));
assertThat(doc.rootDoc().getFields("point.lat")[0].numericValue().doubleValue(), equalTo(1.2)); assertThat(doc.rootDoc().getFields("point.lat")[0].numericValue().doubleValue(), equalTo(1.2));

View File

@ -144,7 +144,7 @@ public class FuzzyQueryBuilderTests extends AbstractQueryTestCase<FuzzyQueryBuil
"}\n"; "}\n";
Query parsedQuery = parseQuery(query).toQuery(createShardContext()); Query parsedQuery = parseQuery(query).toQuery(createShardContext());
Query expected; Query expected;
if (getIndexVersionCreated().onOrAfter(Version.V_5_0_0)) { if (getIndexVersionCreated().onOrAfter(Version.V_5_0_0_alpha2)) {
expected = IntPoint.newRangeQuery(INT_FIELD_NAME, 7, 17); expected = IntPoint.newRangeQuery(INT_FIELD_NAME, 7, 17);
} else { } else {
expected = LegacyNumericRangeQuery.newIntRange(INT_FIELD_NAME, 7, 17, true, true); expected = LegacyNumericRangeQuery.newIntRange(INT_FIELD_NAME, 7, 17, true, true);

View File

@ -396,7 +396,7 @@ public class QueryStringQueryBuilderTests extends AbstractQueryTestCase<QueryStr
public void testToQueryNumericRangeQuery() throws Exception { public void testToQueryNumericRangeQuery() throws Exception {
assumeTrue("test runs only when at least a type is registered", getCurrentTypes().length > 0); assumeTrue("test runs only when at least a type is registered", getCurrentTypes().length > 0);
Query query = queryStringQuery("12~0.2").defaultField(INT_FIELD_NAME).toQuery(createShardContext()); Query query = queryStringQuery("12~0.2").defaultField(INT_FIELD_NAME).toQuery(createShardContext());
if (getIndexVersionCreated().onOrAfter(Version.V_5_0_0)) { if (getIndexVersionCreated().onOrAfter(Version.V_5_0_0_alpha2)) {
assertEquals(IntPoint.newExactQuery(INT_FIELD_NAME, 12), query); assertEquals(IntPoint.newExactQuery(INT_FIELD_NAME, 12), query);
} else { } else {
LegacyNumericRangeQuery fuzzyQuery = (LegacyNumericRangeQuery) query; LegacyNumericRangeQuery fuzzyQuery = (LegacyNumericRangeQuery) query;

View File

@ -89,7 +89,7 @@ public class Murmur3FieldMapper extends FieldMapper {
throw new MapperParsingException("Setting [index] cannot be modified for field [" + name + "]"); throw new MapperParsingException("Setting [index] cannot be modified for field [" + name + "]");
} }
if (parserContext.indexVersionCreated().before(Version.V_5_0_0)) { if (parserContext.indexVersionCreated().before(Version.V_5_0_0_alpha2)) {
node.remove("precision_step"); node.remove("precision_step");
} }

View File

@ -22,7 +22,6 @@ package org.elasticsearch.index.mapper.size;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexOptions;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
@ -75,7 +74,7 @@ public class SizeFieldMapper extends MetadataFieldMapper {
private Builder(MappedFieldType existing, Version indexCreated) { private Builder(MappedFieldType existing, Version indexCreated) {
super(NAME, existing == null super(NAME, existing == null
? indexCreated.before(Version.V_5_0_0) ? Defaults.LEGACY_SIZE_FIELD_TYPE : Defaults.SIZE_FIELD_TYPE ? indexCreated.before(Version.V_5_0_0_alpha2) ? Defaults.LEGACY_SIZE_FIELD_TYPE : Defaults.SIZE_FIELD_TYPE
: existing, Defaults.LEGACY_SIZE_FIELD_TYPE); : existing, Defaults.LEGACY_SIZE_FIELD_TYPE);
builder = this; builder = this;
} }
@ -161,7 +160,7 @@ public class SizeFieldMapper extends MetadataFieldMapper {
return; return;
} }
final int value = context.source().length(); final int value = context.source().length();
if (Version.indexCreated(context.indexSettings()).before(Version.V_5_0_0)) { if (Version.indexCreated(context.indexSettings()).before(Version.V_5_0_0_alpha2)) {
fields.add(new LegacyIntegerFieldMapper.CustomIntegerNumericField(value, fieldType())); fields.add(new LegacyIntegerFieldMapper.CustomIntegerNumericField(value, fieldType()));
} else { } else {
boolean indexed = fieldType().indexOptions() != IndexOptions.NONE; boolean indexed = fieldType().indexOptions() != IndexOptions.NONE;

View File

@ -18,6 +18,6 @@ integTest {
cluster { cluster {
numNodes = 2 numNodes = 2
numBwcNodes = 1 numBwcNodes = 1
bwcVersion = "5.0.0-SNAPSHOT" // this is the same as the current version until we released the first RC bwcVersion = "5.0.0-alpha2-SNAPSHOT" // this is the same as the current version until we released the first RC
} }
} }