Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix explain exception in hybrid queries with partial subquery matches #1123

Conversation

martin-gaievski
Copy link
Member

@martin-gaievski martin-gaievski commented Jan 18, 2025

Description

Hybrid query fails with runtime exception in some cases when used with explain flag. To get the error you need to design a hybrid query in a way that documents will match only some of multiple subqueries from hybrid query, and does not match other sub-queries.

Example of such scenario:
2 sub-queries, search hit had top match in sub-query 1 and low score in query 2, such that in sub-query2 results this document is below the "size".

hybrid {
    neural {}
    multi_match {}
}

In this example if score of multi_match query is high and score of neural is very low explain should still show two matches. This is because neural will have positive score for any document, even if that document is below top K semantically similar documents.

Reason for the error is incorrect assumption that we took during implementation that search hit will have matches in every sub-query. In case of only partial match that leads to the index out of bounds exception because collections with explanation details and search hit details are of different sizes.

Example of query I used to reproduce the problem:

{
    "size": 100,
    "_source": {
        "exclude": [
            "passage_embedding"
        ]
    },
    "query": {
        "hybrid": {
            "queries": [
                {
                    "neural": {
                        "passage_embedding": {
                            "query_text": "What is the mechanism of inflammatory response and pathogenesis of COVID-19 cases?",
                            "model_id": "xn0ddpQBU-oejfwL-9TW",
                            "k": 100
                        }
                    }
                },
                {
                    "multi_match": {
                        "query": "What is the mechanism of inflammatory response and pathogenesis of COVID-19 cases?",
                        "type": "best_fields",
                        "fields": [
                            "text_key",
                            "title_key"
                        ],
                        "tie_breaker": 0.5
                    }
                }
            ]
        }
    }
}

and this is response I got

{
    "error": {
        "root_cause": [
            {
                "type": "index_out_of_bounds_exception",
                "reason": "Index 1 out of bounds for length 1"
            }
        ],
        "type": "index_out_of_bounds_exception",
        "reason": "Index 1 out of bounds for length 1"
    },
    "status": 500
}

following exception is in the log

[2025-01-21T13:49:16,783][INFO ][o.o.n.s.c.HybridTopScoreDocCollector] [integTest-2] hit count threshold reached: total hits=10000, threshold=10000, action=updating_results
        at org.opensearch.search.pipeline.SearchResponseProcessor.processResponseAsync(SearchResponseProcessor.java:66) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.search.pipeline.Pipeline.lambda$transformResponseListener$9(Pipeline.java:230) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.core.action.ActionListener$1.onResponse(ActionListener.java:82) [opensearch-core-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.search.pipeline.Pipeline.lambda$transformResponseListener$10(Pipeline.java:259) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
    ....
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) [netty-transport-4.1.115.Final.jar:4.1.115.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) [netty-common-4.1.115.Final.jar:4.1.115.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.115.Final.jar:4.1.115.Final]
        at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100) ~[?:?]
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106) ~[?:?]
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302) ~[?:?]
        at java.base/java.util.Objects.checkIndex(Objects.java:385) ~[?:?]
        at java.base/java.util.ArrayList.get(ArrayList.java:427) ~[?:?]
        at org.opensearch.neuralsearch.processor.ExplanationResponseProcessor.processResponse(ExplanationResponseProcessor.java:106) ~[?:?]
        at org.opensearch.search.pipeline.SearchResponseProcessor.processResponseAsync(SearchResponseProcessor.java:64) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]

I ran this query for a trec-covid dataset https://huggingface.co/datasets/nreimers/trec-covid on a cluster with 3 data nodes and 12 shards.

This fix affects response format for both "by query" and "by document id" requests with explain.

Below are examples of both responses after my change:

explain in "by query" mode

{
    "took": 818,
    "timed_out": false,
    "_shards": {
        "total": 12,
        "successful": 12,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 10000,
            "relation": "gte"
        },
        "max_score": 0.5,
        "hits": [
            {
                "_shard": "[my-nlp-index-1][4]",
                "_node": "So8xwxyzQSaRMx4Mn3wfFA",
                "_index": "my-nlp-index-1",
                "_id": "iaatjew2",
                "_score": 0.5,
                "_source": {
                    "title_key": "The pathogenesis and treatment of the `Cytokine Storm' in COVID-19",
                    "passage_text": "The pathogenesis and treatment of the `Cytokine Storm' in COVID-19 Cytokine storm is an excessive immune response to external stimuli. The pathogenesis of the cytokine storm is complex. The disease progresses rapidly, and the mortality is high. Certain evidence shows that, during the coronavirus disease 2019 (COVID-19) epidemic, the severe deterioration of some patients has been closely related to the cytokine storm in their bodies. This article reviews the occurrence mechanism and treatment strategies of",
                    "text_key": "Cytokine storm is an excessive immune response to external stimuli. The pathogenesis of the cytokine storm is complex. The disease progresses rapidly, and the mortality is high. Certain evidence shows that, during the coronavirus disease 2019 (COVID-19) epidemic, the severe deterioration of some patients has been closely related to the cytokine storm in their bodies. This article reviews the occurrence mechanism and treatment strategies of the COVID-19 virus-induced inflammatory storm in attempt to provide valuable medication guidance for clinical treatment."
                },
                "_explanation": {
                    "value": 0.5,
                    "description": "arithmetic_mean combination of:",
                    "details": [
                        {
                            "value": 1.0,
                            "description": "min_max normalization of:",
                            "details": [
                                {
                                    "value": 27.25991,
                                    "description": "max plus 0.5 times others of:",
                                    "details": [
                                        {
                                            "value": 12.376112,
                                            "description": "sum of:",
                                            "details": [
                                                {
                                                    "value": 1.0223094,
                                                    "description": "weight(title_key:and in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 1.0223094,
                                                            "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 0.94612366,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 5577,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 14365,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.49114734,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1.0,
                                                                            "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": 11.0,
                                                                            "description": "dl, length of field",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 13.4501915,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 5.8246403,
                                                    "description": "weight(title_key:pathogenesis in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 5.8246403,
                                                            "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 5.390569,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 65,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 14365,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.49114734,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1.0,
                                                                            "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": 11.0,
                                                                            "description": "dl, length of field",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 13.4501915,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 1.4807031,
                                                    "description": "weight(title_key:the in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 1.4807031,
                                                            "description": "score(freq=2.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 1.0217016,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 5171,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 14365,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.6587509,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 2.0,
                                                                            "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": 11.0,
                                                                            "description": "dl, length of field",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 13.4501915,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 1.3276497,
                                                    "description": "weight(title_key:19 in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 1.3276497,
                                                            "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 1.228709,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 4204,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 14365,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.49114734,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1.0,
                                                                            "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": 11.0,
                                                                            "description": "dl, length of field",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 13.4501915,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 1.3189471,
                                                    "description": "weight(title_key:covid in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 1.3189471,
                                                            "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 1.2206548,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 4238,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 14365,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.49114734,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1.0,
                                                                            "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": 11.0,
                                                                            "description": "dl, length of field",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 13.4501915,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 1.4018621,
                                                    "description": "weight(title_key:of in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 1.4018621,
                                                            "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 4.4,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 0.6486954,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 7509,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 14365,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.49114734,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1.0,
                                                                            "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": 11.0,
                                                                            "description": "dl, length of field",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 13.4501915,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        {
                                            "value": 21.071854,
                                            "description": "sum of:",
                                            "details": [
                                                {
                                                    "value": 0.051274747,
                                                    "description": "weight(text_key:and in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 0.051274747,
                                                            "description": "score(freq=2.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 0.030887006,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 10376,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 10701,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.7545796,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 2.0,
                                                                            "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": 80.0,
                                                                            "description": "dl, length of field (approximate)",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 205.43108,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 4.3727093,
                                                    "description": "weight(text_key:mechanism in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 4.3727093,
                                                            "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 3.2804909,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 402,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 10701,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.6058834,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1.0,
                                                                            "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": 80.0,
                                                                            "description": "dl, length of field (approximate)",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 205.43108,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 4.576253,
                                                    "description": "weight(text_key:pathogenesis in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 4.576253,
                                                            "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 3.4331932,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 345,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 10701,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.6058834,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1.0,
                                                                            "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": 80.0,
                                                                            "description": "dl, length of field (approximate)",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 205.43108,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 4.079584,
                                                    "description": "weight(text_key:inflammatory in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 4.079584,
                                                            "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 3.0605824,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 501,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 10701,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.6058834,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1.0,
                                                                            "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": 80.0,
                                                                            "description": "dl, length of field (approximate)",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 205.43108,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 0.72124374,
                                                    "description": "weight(text_key:is in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 0.72124374,
                                                            "description": "score(freq=3.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 0.39892235,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 7181,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 10701,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.8218092,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 3.0,
                                                                            "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": 80.0,
                                                                            "description": "dl, length of field (approximate)",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 205.43108,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 0.085298546,
                                                    "description": "weight(text_key:of in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 0.085298546,
                                                            "description": "score(freq=3.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 4.4,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 0.023589456,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 10452,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 10701,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.8218092,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 3.0,
                                                                            "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": 80.0,
                                                                            "description": "dl, length of field (approximate)",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 205.43108,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 2.1462643,
                                                    "description": "weight(text_key:covid in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 2.1462643,
                                                            "description": "score(freq=2.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 1.2928717,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 2937,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 10701,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.7545796,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 2.0,
                                                                            "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": 80.0,
                                                                            "description": "dl, length of field (approximate)",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 205.43108,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 0.04428081,
                                                    "description": "weight(text_key:the in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 0.04428081,
                                                            "description": "score(freq=9.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 0.021582382,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 10473,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 10701,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.93259585,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 9.0,
                                                                            "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": 80.0,
                                                                            "description": "dl, length of field (approximate)",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 205.43108,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 2.9669957,
                                                    "description": "weight(text_key:response in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 2.9669957,
                                                            "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 2.2258976,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1155,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 10701,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.6058834,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1.0,
                                                                            "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": 80.0,
                                                                            "description": "dl, length of field (approximate)",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 205.43108,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 2.0279489,
                                                    "description": "weight(text_key:19 in 1487) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 2.0279489,
                                                            "description": "score(freq=2.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 1.2216007,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 3154,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 10701,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.7545796,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 2.0,
                                                                            "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": 80.0,
                                                                            "description": "dl, length of field (approximate)",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 205.43108,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            },
            {
                "_shard": "[my-nlp-index-1][11]",
                "_node": "BwhhFPwCQEuLiqJSSNTjEQ",
                "_index": "my-nlp-index-1",
                "_id": "klcf0eqc",
                "_score": 0.5,
                "_source": {
                    "title_key": "More on Covid-19 in Immune-Mediated Inflammatory Diseases.",
                    "passage_text": "More on Covid-19 in Immune-Mediated Inflammatory Diseases.",
                    "text_key": ""
                },
                "_explanation": {
                    "value": 0.5,
                    "description": "arithmetic_mean combination of:",
                    "details": [
                        {
                            "value": 1.0,
                            "description": "min_max normalization of:",
                            "details": [
                                {
                                    "value": 0.055166073,
                                    "description": "within top 100",
                                    "details": []
                                }
                            ]
                        },
                        {
                            "value": 0.0,
                            "description": "min_max normalization of:",
                            "details": [
                                {
                                    "value": 8.98535,
                                    "description": "max plus 0.5 times others of:",
                                    "details": [
                                        {
                                            "value": 8.98535,
                                            "description": "sum of:",
                                            "details": [
                                                {
                                                    "value": 1.4543076,
                                                    "description": "weight(title_key:covid in 985) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 1.4543076,
                                                            "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 1.2548273,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 4113,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 14426,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.5268047,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1.0,
                                                                            "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": 9.0,
                                                                            "description": "dl, length of field",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 13.539789,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 6.072501,
                                                    "description": "weight(title_key:inflammatory in 985) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 6.072501,
                                                            "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 5.239566,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 76,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 14426,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.5268047,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1.0,
                                                                            "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": 9.0,
                                                                            "description": "dl, length of field",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 13.539789,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value": 1.4585414,
                                                    "description": "weight(title_key:19 in 985) [PerFieldSimilarity], result of:",
                                                    "details": [
                                                        {
                                                            "value": 1.4585414,
                                                            "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                                            "details": [
                                                                {
                                                                    "value": 2.2,
                                                                    "description": "boost",
                                                                    "details": []
                                                                },
                                                                {
                                                                    "value": 1.2584804,
                                                                    "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 4098,
                                                                            "description": "n, number of documents containing term",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 14426,
                                                                            "description": "N, total number of documents with field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value": 0.5268047,
                                                                    "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                                    "details": [
                                                                        {
                                                                            "value": 1.0,
                                                                            "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": 9.0,
                                                                            "description": "dl, length of field",
                                                                            "details": []
                                                                        },
                                                                        {
                                                                            "value": 13.539789,
                                                                            "description": "avgdl, average length of field",
                                                                            "details": []
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            }
        ]
    }
}

example response for "explain by doc id" query

{
    "_index": "my-nlp-index-1",
    "_id": "klcf0eqc",
    "matched": true,
    "explanation": {
        "value": 8.985349655151367,
        "description": "combined score of:",
        "details": [
            {
                "value": 8.98535,
                "description": "max plus 0.5 times others of:",
                "details": [
                    {
                        "value": 8.98535,
                        "description": "sum of:",
                        "details": [
                            {
                                "value": 1.4543076,
                                "description": "weight(title_key:covid in 985) [PerFieldSimilarity], result of:",
                                "details": [
                                    {
                                        "value": 1.4543076,
                                        "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                        "details": [
                                            {
                                                "value": 2.2,
                                                "description": "boost",
                                                "details": []
                                            },
                                            {
                                                "value": 1.2548273,
                                                "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                "details": [
                                                    {
                                                        "value": 4113,
                                                        "description": "n, number of documents containing term",
                                                        "details": []
                                                    },
                                                    {
                                                        "value": 14426,
                                                        "description": "N, total number of documents with field",
                                                        "details": []
                                                    }
                                                ]
                                            },
                                            {
                                                "value": 0.5268047,
                                                "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                "details": [
                                                    {
                                                        "value": 1.0,
                                                        "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": 9.0,
                                                        "description": "dl, length of field",
                                                        "details": []
                                                    },
                                                    {
                                                        "value": 13.539789,
                                                        "description": "avgdl, average length of field",
                                                        "details": []
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "value": 1.4585414,
                                "description": "weight(title_key:19 in 985) [PerFieldSimilarity], result of:",
                                "details": [
                                    {
                                        "value": 1.4585414,
                                        "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                        "details": [
                                            {
                                                "value": 2.2,
                                                "description": "boost",
                                                "details": []
                                            },
                                            {
                                                "value": 1.2584804,
                                                "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                "details": [
                                                    {
                                                        "value": 4098,
                                                        "description": "n, number of documents containing term",
                                                        "details": []
                                                    },
                                                    {
                                                        "value": 14426,
                                                        "description": "N, total number of documents with field",
                                                        "details": []
                                                    }
                                                ]
                                            },
                                            {
                                                "value": 0.5268047,
                                                "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                "details": [
                                                    {
                                                        "value": 1.0,
                                                        "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": 9.0,
                                                        "description": "dl, length of field",
                                                        "details": []
                                                    },
                                                    {
                                                        "value": 13.539789,
                                                        "description": "avgdl, average length of field",
                                                        "details": []
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "value": 6.072501,
                                "description": "weight(title_key:inflammatory in 985) [PerFieldSimilarity], result of:",
                                "details": [
                                    {
                                        "value": 6.072501,
                                        "description": "score(freq=1.0), computed as boost * idf * tf from:",
                                        "details": [
                                            {
                                                "value": 2.2,
                                                "description": "boost",
                                                "details": []
                                            },
                                            {
                                                "value": 5.239566,
                                                "description": "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                                                "details": [
                                                    {
                                                        "value": 76,
                                                        "description": "n, number of documents containing term",
                                                        "details": []
                                                    },
                                                    {
                                                        "value": 14426,
                                                        "description": "N, total number of documents with field",
                                                        "details": []
                                                    }
                                                ]
                                            },
                                            {
                                                "value": 0.5268047,
                                                "description": "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
                                                "details": [
                                                    {
                                                        "value": 1.0,
                                                        "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": 9.0,
                                                        "description": "dl, length of field",
                                                        "details": []
                                                    },
                                                    {
                                                        "value": 13.539789,
                                                        "description": "avgdl, average length of field",
                                                        "details": []
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Related Issues

#658

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Jan 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.42%. Comparing base (660f577) to head (79f6a58).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1123      +/-   ##
============================================
- Coverage     80.46%   80.42%   -0.05%     
  Complexity     1214     1214              
============================================
  Files            93       93              
  Lines          4162     4163       +1     
  Branches        700      700              
============================================
- Hits           3349     3348       -1     
- Misses          543      545       +2     
  Partials        270      270              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@martin-gaievski martin-gaievski force-pushed the fixed_exception_explain_in_hq_for_multiple_subqueries branch 5 times, most recently from f041b80 to 2579aae Compare January 20, 2025 21:31
@martin-gaievski martin-gaievski changed the title Fixed exception for explain in hybrid query when partial match in subqueries Fix explain exception in hybrid queries with partial subquery matches Jan 21, 2025
@martin-gaievski martin-gaievski force-pushed the fixed_exception_explain_in_hq_for_multiple_subqueries branch 2 times, most recently from 1c94aed to 2654d8e Compare January 21, 2025 21:27
@martin-gaievski martin-gaievski marked this pull request as ready for review January 21, 2025 21:45
@martin-gaievski martin-gaievski added Bug Fixes Changes to a system or product designed to handle a programming bug/glitch v2.19.0 backport 2.x Label will add auto workflow to backport PR to 2.x branch labels Jan 21, 2025
…queries

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
@martin-gaievski martin-gaievski force-pushed the fixed_exception_explain_in_hq_for_multiple_subqueries branch from 2654d8e to c8a7d72 Compare January 21, 2025 21:55
Copy link
Member

@owaiskazi19 owaiskazi19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG overall

…nResponseProcessor.java

Co-authored-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
…ubqueries

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
@martin-gaievski martin-gaievski merged commit 8c743ec into opensearch-project:main Jan 22, 2025
36 of 40 checks passed
@martin-gaievski martin-gaievski deleted the fixed_exception_explain_in_hq_for_multiple_subqueries branch January 22, 2025 23:43
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 22, 2025
…#1123)

* Fixed exception for explain in hybrid query when partial match in subqueries

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
(cherry picked from commit 8c743ec)
martin-gaievski added a commit that referenced this pull request Jan 23, 2025
…#1123) (#1137)

* Fixed exception for explain in hybrid query when partial match in subqueries

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
(cherry picked from commit 8c743ec)

Co-authored-by: Martin Gaievski <gaievski@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Label will add auto workflow to backport PR to 2.x branch Bug Fixes Changes to a system or product designed to handle a programming bug/glitch v2.19.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants