diff --git a/server/src/main/java/org/elasticsearch/index/mapper/VersionFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/VersionFieldMapper.java index 8f69f6afe47db..0d4f5562d3046 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/VersionFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/VersionFieldMapper.java @@ -21,7 +21,11 @@ import java.util.Collections; -/** Mapper for the _version field. */ +/** Mapper for the _version field. + * + * This is the field mapper for the monotonically increasing document version. If you are looking for the field that stores semver style + * strings in a sortable binary format, you want VersionStringFieldMapper in the xpack VersionField plugin + */ public class VersionFieldMapper extends MetadataFieldMapper { public static final String NAME = "_version"; diff --git a/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java b/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java index 1ed63bb17e201..e233df2af3fbd 100644 --- a/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java +++ b/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java @@ -75,6 +75,10 @@ /** * A {@link FieldMapper} for indexing fields with version strings. + * + * The binary encoding of these strings will sort without decoding, according to semver. See {@link VersionEncoder} + * + * NB: If you are looking for the document version field _version, you want {@link org.elasticsearch.index.mapper.VersionFieldMapper} */ public class VersionStringFieldMapper extends FieldMapper {