Fix the version check for LegacyGeoShapeFieldMapper (#38547)
Change version check from 7.0 to 6.6 in BaseGeoShapeFieldMapper to correctly use LegacyGeoShapeFieldMapper for indexes created prior to 6.6.
This commit is contained in:
parent
f8426d9b76
commit
e2f432a413
|
@ -190,7 +190,7 @@ public abstract class BaseGeoShapeFieldMapper extends FieldMapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final Builder builder;
|
final Builder builder;
|
||||||
if (parsedDeprecatedParams || parserContext.indexVersionCreated().before(Version.V_7_0_0)) {
|
if (parsedDeprecatedParams || parserContext.indexVersionCreated().before(Version.V_6_6_0)) {
|
||||||
// Legacy index-based shape
|
// Legacy index-based shape
|
||||||
builder = new LegacyGeoShapeFieldMapper.Builder(name, deprecatedParameters);
|
builder = new LegacyGeoShapeFieldMapper.Builder(name, deprecatedParameters);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class ExternalMapper extends FieldMapper {
|
||||||
BinaryFieldMapper binMapper = binBuilder.build(context);
|
BinaryFieldMapper binMapper = binBuilder.build(context);
|
||||||
BooleanFieldMapper boolMapper = boolBuilder.build(context);
|
BooleanFieldMapper boolMapper = boolBuilder.build(context);
|
||||||
GeoPointFieldMapper pointMapper = latLonPointBuilder.build(context);
|
GeoPointFieldMapper pointMapper = latLonPointBuilder.build(context);
|
||||||
BaseGeoShapeFieldMapper shapeMapper = (context.indexCreatedVersion().before(Version.V_7_0_0))
|
BaseGeoShapeFieldMapper shapeMapper = (context.indexCreatedVersion().before(Version.V_6_6_0))
|
||||||
? legacyShapeBuilder.build(context)
|
? legacyShapeBuilder.build(context)
|
||||||
: shapeBuilder.build(context);
|
: shapeBuilder.build(context);
|
||||||
FieldMapper stringMapper = (FieldMapper)stringBuilder.build(context);
|
FieldMapper stringMapper = (FieldMapper)stringBuilder.build(context);
|
||||||
|
|
Loading…
Reference in New Issue