sql icon indicating copy to clipboard operation
sql copied to clipboard

how can query on multiple indexes,like we do in sql join ( inner join,left join etc) using DSL in opensearch

Open Shivacharangoud opened this issue 3 years ago • 10 comments

how can query on multiple indexes,like we do in sql join ( inner join,left join etc) using DSL in opensearch @anirudha @kyleconroy @spk @mattweber

Shivacharangoud avatar Sep 26 '22 14:09 Shivacharangoud

Let's move this to SQL repo.

dblock avatar Oct 06 '22 14:10 dblock

@anirudha @anirudha @kyleconroy @spk @smortex @

Shivacharangoud avatar Sep 26 '22 20:09 Shivacharangoud

Hey @Shivacharangoud. Can you please give an example/sample request that you run with SQL join?

And just to be clear, SQL here refers to - https://github.com/opensearch-project/sql, right?

(Removing the bug label)

kotwanikunal avatar Sep 26 '22 20:09 kotwanikunal

Closing due to no follow up.

@Shivacharangoud feel free to reopen if you still have questions. Please note that the forum is also a great place for general discussion and to seek help about OpenSearch.

andrross avatar Oct 06 '22 00:10 andrross

@kotwanikunal Suppose I run sql request as : POST _plugins/_sql {"query":"SELECT * FROM indexone INNER JOIN indextwo ON indexone.contactid=indextwo.contactid"}

I want to do the same using DSL, how can I do it. Please answer this. @kotwanikunal @andrross

Shivacharangoud avatar Oct 06 '22 06:10 Shivacharangoud

Yaa okay but i need answer to this. Can any one respond

Shivacharangoud avatar Oct 06 '22 15:10 Shivacharangoud

Answer this please

Shivacharangoud avatar Oct 06 '22 15:10 Shivacharangoud

Please answer this

Shivacharangoud avatar Oct 06 '22 15:10 Shivacharangoud

@Shivacharangoud DSL query is part of OpenSearch core. AFAIK, there is no join support in DSL. You can take a look at parent-child field and nested field. These may be the only support in OpenSearch: https://opensearch.org/docs/latest/opensearch/supported-field-types/join/

dai-chen avatar Oct 06 '22 16:10 dai-chen

I'm transferring this issue back to OpenSearch core repo. Because the ask was "I want to do the same using DSL, how can I do it." @dblock

dai-chen avatar Oct 06 '22 16:10 dai-chen