You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support highlighting function in SQL/PPL query engine #636
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.
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:
@forestmvey Quick question: If we go for option #2, is it possible there are more than one nested level to flatten? ex. highlight(*).field1.nestField1
@dai-chen
I would expect if the data source has fields nested in this way, that this would be possible. Perhaps option #1 would be more predictable in this case.
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 syntaxhighlight(... -- using a parenthesis -- is different from the syntax of existing PPL commands. Looking at the docs, the different arguments are usually delimited with spaces. Shouldn't highlight be the same?
@dai-chen@joshuali925@penghuo
Here's a quick demo on usage for highlight in SQL and PPL for #827.
(NOTE: highlight in PPL is still undergoing design. discussions of PPL syntax can be made here)
Activity
forestmvey commentedon Aug 15, 2022
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:
MaxKsyunz commentedon Aug 17, 2022
@penghuo, @dai-chen, @joshuali925 which response structure do you think is more appropriate?
dai-chen commentedon Aug 17, 2022
@forestmvey Quick question: If we go for option #2, is it possible there are more than one nested level to flatten? ex.
highlight(*).field1.nestField1forestmvey commentedon Aug 17, 2022
@dai-chen
I would expect if the data source has fields nested in this way, that this would be possible. Perhaps option #1 would be more predictable in this case.
dai-chen commentedon Aug 17, 2022
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.
MaxKsyunz commentedon Sep 10, 2022
@acarbonetto The syntax
highlight(...-- using a parenthesis -- is different from the syntax of existing PPL commands. Looking at the docs, the different arguments are usually delimited with spaces. Shouldn'thighlightbe the same?forestmvey commentedon Oct 3, 2022
@dai-chen @joshuali925 @penghuo
Here's a quick demo on usage for highlight in SQL and PPL for #827.
(NOTE: highlight in PPL is still undergoing design. discussions of PPL syntax can be made here)
highlight_demo.mp4
dai-chen commentedon Oct 3, 2022
@forestmvey Thanks for the work! We may post it in discussion as well like what @MaxKsyunz did? #850
forestmvey commentedon Oct 3, 2022
Here I have posted it, thanks for this: #879
dai-chen commentedon Dec 14, 2022
Closing this and track the only remaining item in #916.