[Feature] Calcite PPL search result highlighting#5141
[Feature] Calcite PPL search result highlighting#5141RyanL1997 wants to merge 18 commits intoopensearch-project:mainfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds per-request PPL highlighting end-to-end: request parsing, plan-level propagation via ThreadLocal, conditional hidden Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant PPLService
participant Planner as CalcitePlanner
participant Worker as ExecThread
participant CalciteCtx as CalcitePlanContext
participant OpenSearch as OpenSearchNode
participant Enumerator as OpenSearchIndexEnumerator
participant Protocol as QueryResult/Formatter
Client->>PPLService: POST /_plugins/_ppl (with optional "highlight")
PPLService->>Planner: build execution plan
PPLService->>Planner: set plan.highlightConfig
Planner->>Worker: submit plan (worker thread)
Worker->>CalciteCtx: setHighlightConfig(plan.highlightConfig)
Worker->>OpenSearch: execute search (HighlightBuilder attached)
OpenSearch-->>Enumerator: return hits with highlight fragments
Enumerator->>Worker: produce rows including hidden _highlight value
Worker->>Protocol: build QueryResult (extract highlights())
Worker->>CalciteCtx: clearHighlightConfig()
Protocol-->>Client: JSON response (optional "highlights" array)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
333a24b to
a4d156e
Compare
|
Persistent review updated to latest commit 5bda888 |
Hi @dai-chen. Thanks for the suggestion. After checking, I went with option 2 — accept arbitrary DSL and merge it with the Why not option 1 (make highlight part of PPL syntax)?The main issue is the response format. The V2 highlight() function returns highlights inline as columns in datarows: {
"schema": [
{ "name": "Tags", "type": "text" },
{ "name": "highlight('Tags')", "type": "nested" }
],
"datarows": [
["yeast home-brew", ["<em>yeast</em> home-brew"]]
]
}OSD Explore already knows how to consume highlights from DSL, where they come back as a separate metadata array parallel to the hits. Our current approach matches that shape: {
"schema": [{ "name": "Tags", "type": "text" }],
"datarows": [["yeast home-brew"]],
"highlights": [{ "Tags": ["<em>yeast</em> home-brew"] }]
}If we went with the Current design:The plumbing is now generic. Instead of a highlight-specific pipeline (
To add a future extension (e.g. suggest, rescore, post_filter), you would:
No new end-to-end plumbing needed. So please take a look again thanks! |
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit b290e06.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Persistent review updated to latest commit b290e06 |
|
This PR is stalled because it has been open for 2 weeks with no activity. |
b290e06 to
ff9eb4f
Compare
|
Persistent review updated to latest commit ff9eb4f |
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
ff9eb4f to
6abfc1a
Compare
|
Persistent review updated to latest commit 6abfc1a |
Description.
Related Issues
Check List
--signoffor-s.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.