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
One ideal scenario for OpenSearch is to run a DLS query that filters documents and return the result alongs with related aggregations (facets) and related highlights all in one query. Can we have this exact behaviour in SQL?
The way I can think of it is, I write a main SQL query (which is a search/filter query) then I can add a highlights function that accepts parameters such as fields names and then add an aggregation clause (an aggregation SQL statement). It can look like the below example.
select doc_name, author, location, highlights(('doc_name','author')) as doc_highlights from my-docs where author='hasan' aggregate by (select count(*), location from my-docs group by location)
One ideal scenario for OpenSearch is to run a DLS query that filters documents and return the result alongs with related aggregations (facets) and related highlights all in one query. Can we have this exact behaviour in SQL?
The way I can think of it is, I write a main SQL query (which is a search/filter query) then I can add a highlights function that accepts parameters such as fields names and then add an aggregation clause (an aggregation SQL statement). It can look like the below example.
select doc_name, author, location, highlights(('doc_name','author')) as doc_highlights from my-docs where author='hasan' aggregate by (select count(*), location from my-docs group by location)
The result will be two tables as follows:
Tables 1:
doc_name | author | location | highlights |
doc1 | hasan | /folder1 | JSON highlights
.
.
Table 2
count(*) | location
10 | /folder1
2 | /folder2
Note1:
The aggregation only applies on the result of the main query.
Note2:
Highlights can returned in exactly the same JSON format that is produced for a DSL query or any other workable format.
The text was updated successfully, but these errors were encountered: