Open yuye-aws opened 7 months ago
If I search with BM25 query:
GET {indexname}/_search?explain=true
{
"size": 1,
"query": {
"match": {
"text_chunk": "Global-Locally Self-Attentive Dialogue State Tracker"
}
}
}
The explanation is very detailed like
{
"value": 18.182425,
"description": "sum of:",
"details": [
{
"value": 4.982006,
"description": "weight(text_chunk:self in 20446) [PerFieldSimilarity], result of:",
"details": [
{
"value": 4.982006,
"description": "score(freq=2.0), computed as boost * idf * tf from:",
"details": [
{
"value": 2.2,
"description": "boost",
"details": []
},
{
"value": 3.1877272,
"description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
"details": [
{
"value": 351,
"description": "n, number of documents containing term",
"details": []
},
{
"value": 8517,
"description": "N, total number of documents with field",
"details": []
}
]
},
{
"value": 0.7103958,
"description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
"details": [
{
"value": 2,
"description": "freq, occurrences of term within document",
"details": []
},
{
"value": 1.2,
"description": "k1, term saturation parameter",
"details": []
},
{
"value": 0.75,
"description": "b, length normalization parameter",
"details": []
},
{
"value": 104,
"description": "dl, length of field (approximate)",
"details": []
},
{
"value": 181.63051,
"description": "avgdl, average length of field",
"details": []
}
]
}
]
}
]
},
{
"value": 10.799234,
"description": "weight(text_chunk:attentive in 20446) [PerFieldSimilarity], result of:",
"details": [
{
"value": 10.799234,
"description": "score(freq=2.0), computed as boost * idf * tf from:",
"details": [
{
"value": 2.2,
"description": "boost",
"details": []
},
{
"value": 6.9098706,
"description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
"details": [
{
"value": 8,
"description": "n, number of documents containing term",
"details": []
},
{
"value": 8517,
"description": "N, total number of documents with field",
"details": []
}
]
},
{
"value": 0.7103958,
"description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
"details": [
{
"value": 2,
"description": "freq, occurrences of term within document",
"details": []
},
{
"value": 1.2,
"description": "k1, term saturation parameter",
"details": []
},
{
"value": 0.75,
"description": "b, length normalization parameter",
"details": []
},
{
"value": 104,
"description": "dl, length of field (approximate)",
"details": []
},
{
"value": 181.63051,
"description": "avgdl, average length of field",
"details": []
}
]
}
]
}
]
},
{
"value": 2.401184,
"description": "weight(text_chunk:state in 20446) [PerFieldSimilarity], result of:",
"details": [
{
"value": 2.401184,
"description": "score(freq=1.0), computed as boost * idf * tf from:",
"details": [
{
"value": 2.2,
"description": "boost",
"details": []
},
{
"value": 1.9813391,
"description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
"details": [
{
"value": 1174,
"description": "n, number of documents containing term",
"details": []
},
{
"value": 8517,
"description": "N, total number of documents with field",
"details": []
}
]
},
{
"value": 0.55086344,
"description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
"details": [
{
"value": 1,
"description": "freq, occurrences of term within document",
"details": []
},
{
"value": 1.2,
"description": "k1, term saturation parameter",
"details": []
},
{
"value": 0.75,
"description": "b, length normalization parameter",
"details": []
},
{
"value": 104,
"description": "dl, length of field (approximate)",
"details": []
},
{
"value": 181.63051,
"description": "avgdl, average length of field",
"details": []
}
]
}
]
}
]
}
]
}
@yuye-aws neural search will not have detailed response for explain as it uses knn
query under the hood, and knn
query doesn't support explain. Here is the corresponding GH issue for this matter: https://github.com/opensearch-project/k-NN/issues/875
@yuye-aws neural search will not have detailed response for explain as it uses
knn
query under the hood, andknn
query doesn't support explain. Here is the corresponding GH issue for this matter: opensearch-project/k-NN#875
Sorry for taking long to respond. It seems quite likely that after this issue will automatically get resolved after https://github.com/opensearch-project/k-NN/issues/875/. Just out of curiosity, do we have an ongoing plan to resolve the k-NN issue?
What is the bug?
Searching for nested field works well. However, we cannot obtain the detailed explanation for search results
GET {indexname}/_search?explain=true
How can one reproduce the bug?
First, create an index with nested field embedding, a sample document may look like:
Then, use the explain query to search the document:
Currently, the explanation for search results is
What is the expected behavior?
The explain query should at least show score for each nested document like the BM25 query.
What is your host/environment?
Operating system, version.
Do you have any screenshots?
If applicable, add screenshots to help explain your problem.
Do you have any additional context?
Add any other context about the problem.