Versions v 3.1.0
When I run pure semantic search with dense vectors via neural query and with nested documents, the inner_hits only contain one result.
Example:
GET my_index/_search
{
"query": {
"nested": {
"path": "embeddings",
"query": {
"neural": {
"embeddings.embedding": {
"query_text": "What is foo bar baz?",
"model_id": "model_id",
"k": 5
}
}
},
"inner_hits": {
"size": 5,
"_source": [
"embeddings.text"
]
}
}
}
}
The inner_hits will only contain 1 chunk per document, not respecting the size parameter.
When I however run this with hybrid search, the size parameter of inner_hit is respected:
GET my_index/_search?search_pipeline=minmax-pipeline
{
"query": {
"hybrid": {
"queries": [
{
"nested": {
"path": "embeddings",
"query": {
"match": {
"embeddings.text": {
"query": "What is foo bar baz?"
}
}
},
"inner_hits": {
"size": 5,
"_source": [
"embeddings.text"
]
}
}
},
{
"nested": {
"path": "embeddings",
"query": {
"neural": {
"embeddings.embedding": {
"query_text": "What is foo bar baz?",
"model_id": "model_id",
"k": 5
}
}
}
}
}
]
}
}
}
Is there a way to get more inner_hits result from the semantic search?
I am running into a scenario now where there are multiple chunks in the first parent document, which have better scores than the winning chunk in second parent document. Which means I am losing context.