-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Open
Labels
:Search Relevance/SearchCatch all for Search RelevanceCatch all for Search Relevance>bugTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearchteam-discuss
Description
Elasticsearch Version
9.2.0
Installed Plugins
No response
Java Version
bundled
OS Version
Darwin Kernel Version 24.6.0
Problem Description
Calling _search with a nested knn query that is using as a filter another nested query on a top-level field produces 0 hits even though it should have matches.
Steps to Reproduce
PUT example
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"properties": {
"nested_1": {
"type": "nested",
"properties": {
"vector": {
"type": "dense_vector",
"dims": 3
}
}
},
"nested_2": {
"type": "nested",
"properties": {
"category": {
"type": "keyword"
}
}
}
}
}
}
PUT example/_doc/1
{
"nested_1" : {
"vector": [1, 2, 3]
},
"nested_2": {
"category": "label_1"
}
}
POST example/_search
{
"query": {
"nested": {
"path": "nested_1",
"query": {
"knn": {
"field": "nested_1.vector",
"query_vector": [1, 2, 3],
"k": 10,
"num_candidates": 10,
"filter": {
"nested": {
"path": "nested_2",
"query": {
"term": {
"nested_2.category": {
"value": "label_1"
}
}
}
}
}
}
}
}
}
}
Logs (if relevant)
No response
mayya-sharipova
Metadata
Metadata
Assignees
Labels
:Search Relevance/SearchCatch all for Search RelevanceCatch all for Search Relevance>bugTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearchteam-discuss