How to write a query with groupBy, having and orderBy with elastic?


(Ali.Houshy) #1

Hi,

I want to write a query in elastic that contain these 3 parts like sql:

  • groupBy
  • having
  • orderBy

How can I write it?


(David Pilato) #2

In elasticsearch you write a search request. It can have:

Group by = the aggregation part
Having = the query part
OrderBy = the sort part


(Andrei Stefan) #3

Hi @ali_houshyaripour,
If you are just starting your journey with Elasticsearch, it might help you the ES-SQL translate API. You can pass an SQL query to it (with some limitations) and it can suggest an ES query. This might help you get started with Elasticsearch.


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.