Skip to content

When I use KNN search, it will cause ES to fail #126809

@zhoucheng89

Description

@zhoucheng89

Elasticsearch Version

8.17.4

Installed Plugins

No response

Java Version

OpenJDK Runtime Environment (23.0+37) (build 23+37-2369)

OS Version

Ubuntu 20.04.6 LTS

Problem Description

I deployed ES8.17.4 using Docker on the host (rocky-linux9.2 x86). The operating system version in the Docker container is Ubuntu 20.04.6 LTS, and the Java version is OpenJDK Runtime Environment (23.0+37) (build 23+37-2369). When I use KNN retrieval, it will cause ES to crash.

Steps to Reproduce

PUT products
{
"mappings": {
"dynamic": "strict",
"properties": {
"department": {
"type": "keyword"
},
"brand": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
},
"description": {
"type": "text"
},
"embedding": {
"type": "dense_vector",
"index": true,
"similarity": "l2_norm"
},
"price": {
"type": "float"
}
}
}
}

POST products/_bulk?refresh=true
{"index":{"_id":1}}
{"department":"backend","brand": ["oepnjdk","otherjdk"], "description":"high-available nice oepnjdk","embedding":[1,1,1,1],"price":100}
{"index":{"_id":2}}
{"department":"backend","brand": ["oraclejdk"],"description":"high-available beautiful oraclejdk","embedding":[1,1,1,1],"price":250}
{"index":{"_id":3}}
{"department":"backend","brand": ["otherjdk"],"description":"every day otherjdk","embedding":[1,1,1,1],"price":50}
{"index":{"_id":4}}
{"department":"backend","brand": ["oepnjdk"],"description":"oepnjdk","embedding":[2,2,2,0],"price":75}
{"index":{"_id":5}}
{"department":"backend","brand": ["oepnjdk"],"description":"oepnjdk 2022","embedding":[2,2,2,0],"price":150}
{"index":{"_id":6}}
{"department":"frontend","brand": ["oepnjdk"], "description":"oepnjdk","embedding":[2,2,2,0],"price":50}

GET products/_search?
{
"size": 10,
"knn": {
"field": "embedding",
"query_vector": [2,2,2,2],
"k":3,
"num_candidates": 10,
"filter": {
"terms": {
"brand": ["oepnjdk","otherjdk"]
}
}
}
}

Logs (if relevant)

hs_err_pid68.log

Metadata

Metadata

Assignees

Labels

:Search Relevance/VectorsVector search>bugTeam:Search RelevanceMeta label for the Search Relevance team in Elasticsearchpriority:normalA label for assessing bug priority to be used by ES engineers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions