From e3da60c23d17fb983000ff78d6670a56a5450514 Mon Sep 17 00:00:00 2001 From: Mayya Sharipova Date: Wed, 20 Nov 2019 07:43:14 -0500 Subject: [PATCH] Increase the number of vector dims to 2048 (#46895) --- docs/reference/mapping/types/dense-vector.asciidoc | 2 +- .../xpack/vectors/mapper/DenseVectorFieldMapper.java | 2 +- .../xpack/vectors/mapper/DenseVectorFieldMapperTests.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/mapping/types/dense-vector.asciidoc b/docs/reference/mapping/types/dense-vector.asciidoc index f1cab428430..df3ae312fa3 100644 --- a/docs/reference/mapping/types/dense-vector.asciidoc +++ b/docs/reference/mapping/types/dense-vector.asciidoc @@ -8,7 +8,7 @@ A `dense_vector` field stores dense vectors of float values. The maximum number of dimensions that can be in a vector should -not exceed 1024. A `dense_vector` field is a single-valued field. +not exceed 2048. A `dense_vector` field is a single-valued field. These vectors can be used for <>. For example, a document score can represent a distance between diff --git a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapper.java b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapper.java index b1518d3ecd5..7656ae0b9c1 100644 --- a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapper.java +++ b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapper.java @@ -43,7 +43,7 @@ import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpect public class DenseVectorFieldMapper extends FieldMapper implements ArrayValueMapperParser { public static final String CONTENT_TYPE = "dense_vector"; - public static short MAX_DIMS_COUNT = 1024; //maximum allowed number of dimensions + public static short MAX_DIMS_COUNT = 2048; //maximum allowed number of dimensions private static final byte INT_BYTES = 4; public static class Defaults { diff --git a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java index 2e3f28676b3..7aee8753c45 100644 --- a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java +++ b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java @@ -61,7 +61,7 @@ public class DenseVectorFieldMapperTests extends ESSingleNodeTestCase { .endObject() .endObject()); MapperParsingException e = expectThrows(MapperParsingException.class, () -> parser.parse("_doc", new CompressedXContent(mapping))); - assertEquals(e.getMessage(), "The number of dimensions for field [my-dense-vector] should be in the range [1, 1024]"); + assertEquals(e.getMessage(), "The number of dimensions for field [my-dense-vector] should be in the range [1, 2048]"); } public void testDefaults() throws Exception {