Increase the number of vector dims to 2048 (#46895)

This commit is contained in:
Mayya Sharipova 2019-11-20 07:43:14 -05:00
parent 6bad28a835
commit e3da60c23d
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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 {