spring-projects / spring-data-elasticsearch

Provide support to increase developer productivity in Java when using Elasticsearch. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-elasticsearch/
Apache License 2.0
2.92k stars 1.33k forks source link

max dims of dense_vector field type should be increased #2911

Closed snurf198 closed 5 months ago

snurf198 commented 5 months ago

spring-data-elasticsearch version: 5.2.5

Hi. I found a bug in the code while creating mapping for the index using indexOps. The target file path is as below

src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java:173

if (type == FieldType.Dense_Vector) {
Assert.isTrue(dims >= 1 && dims <= 2048,
"Invalid required parameter! Dense_Vector value \"dims\" must be between 1 and 2048.");
}

When I create mapping with dense_vector field having dimension 3072, the following error occurs Invalid required parameter! Dense_Vector value "dims" must be between 1 and 2048

Since in elasticsearch 8.11, the max value of dimension of dense_vector field has increased to 4096, the part of the code should be changed. https://github.com/elastic/elasticsearch/pull/99682