-
Notifications
You must be signed in to change notification settings - Fork 141
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
Support highlighting function in SQL/PPL query engine #636
Comments
Looking for input on what should be expected JSON output for the SQL plugin to return from a multi-field highlight query. OpenSearch will respond to a multi-field highlight query with the JSON output I have defined below:
The SQL plugin can handle this response with the nested type allowing for the returned fields to be accessed using the '.' notation. Should the SQL plugin nest all returned fields under a single column shown in the following output:
The SQL plugin could output the JSON format as separate columns for each returned field. Similar to a "SELECT * from ..." SQL query. See the following JSON output for the SQL plugin to output multiple returned fields as multiple columns:
|
@penghuo, @dai-chen, @joshuali925 which response structure do you think is more appropriate? |
@forestmvey Quick question: If we go for option #2, is it possible there are more than one nested level to flatten? ex. |
@dai-chen |
Yeah, I'm thinking about the same. If we go for option #2, not sure about the complexity and if we may fall back to option 1 in certain case. If we only support simple unnested field case, it should be fine. |
@acarbonetto The syntax |
@dai-chen @joshuali925 @penghuo highlight_demo.mp4 |
@forestmvey Thanks for the work! We may post it in discussion as well like what @MaxKsyunz did? #850 |
Here I have posted it, thanks for this: #879 |
Closing this and track the only remaining item in #916. |
Related design for relevance-based search in SQL/PPL engine - #182
TODO List
highlight
function by including it in the search enginehighlight
function in SQL syntax and parser, including parametershighlight
function in PPL syntax and parser, including parametershighlighting
match
search documentationFunction Details
(reference: https://opensearch.org/docs/latest/opensearch/ux/#highlight-query-matches)
The highlighting function adds search term results to the service response for matched terms in fields. Highlighting only works in tandem with match-search queries. The list of highlighted fields must be present in a relevance-based search function, or else the highlighted fields will result in a syntax error.
Syntax
Available Options
<em>
</em>
Sample query
SQL
PPL
Sample response
The text was updated successfully, but these errors were encountered: