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

Support for DSL functionalities #160

Closed
asfoorial opened this issue Jul 15, 2021 · 2 comments
Closed

Support for DSL functionalities #160

asfoorial opened this issue Jul 15, 2021 · 2 comments
Labels
enhancement New feature or request v1.2.0

Comments

@asfoorial
Copy link

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.

@anirudha
Copy link
Collaborator

@asfoorial pls review #182

@acarbonetto
Copy link
Collaborator

The highlight function is being added under #636

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v1.2.0
Projects
None yet
Development

No branches or pull requests

3 participants