Skip to content

Commit

Permalink
Increase the number of vector dims to 2048 (#46895)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayya-sharipova committed Nov 20, 2019
1 parent 6bad28a commit e3da60c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/reference/mapping/types/dense-vector.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<vector-functions,document scoring>>.
For example, a document score can represent a distance between
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void testMappingExceedDimsLimit() throws IOException {
.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 {
Expand Down

0 comments on commit e3da60c

Please sign in to comment.