# SQL interface to Elasticsearch & Aggregation functions

**URL:** https://discuss.elastic.co/t/sql-interface-to-elasticsearch-aggregation-functions/13563
**Category:** Elasticsearch
**Created:** [September 11, 2013, 9:00pm UTC](https://discuss.elastic.co/t/sql-interface-to-elasticsearch-aggregation-functions/13563 "2013-09-11T21:00:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pranav\_amin](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@pranav\_amin](https://discuss.elastic.co/u/pranav_amin)
#### Post date: [September 11, 2013, 9:00pm UTC](https://discuss.elastic.co/t/sql-interface-to-elasticsearch-aggregation-functions/13563/1 "2013-09-11T21:00:13Z")

</div>

Hey guys,

Is there any SQL interface to Elasticsearch? Or if there is any code  
written in Perl or python where i can just input my query and it can  
provide me the results would be great too.  
The output can be in any format as long as i can write a SQL query in the  
code.

Also does Elastic search support the below aggregrated -  
Sum, Group by, Having, First, Last, etc?

Thanks  
Pranav.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![sina\_tamanna](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@sina\_tamanna](https://discuss.elastic.co/u/sina_tamanna)
#### Post date: [September 12, 2013, 6:54am UTC](https://discuss.elastic.co/t/sql-interface-to-elasticsearch-aggregation-functions/13563/2 "2013-09-12T06:54:49Z")

</div>

Elasticsearch is not meant to be RDBM therefore it does not include  
functionalities available in RDBMs. Perhaps you can explain your use case  
so that people could show you possible solutions specific for your problem.

As for the aggregated stuff, take a look at facets[http://www.elasticsearch.org/guide/reference/api/search/facets/](http://www.elasticsearch.org/guide/reference/api/search/facets/)  
.

On Wednesday, September 11, 2013 11:00:13 PM UTC+2, pranav amin wrote:

> Hey guys,
> 
> Is there any SQL interface to Elasticsearch? Or if there is any code  
> written in Perl or python where i can just input my query and it can  
> provide me the results would be great too.  
> The output can be in any format as long as i can write a SQL query in the  
> code.
> 
> Also does Elastic search support the below aggregrated -  
> Sum, Group by, Having, First, Last, etc?
> 
> Thanks  
> Pranav.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Raffaele\_Sena](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raffaele_sena/32/1759_2.png) [@Raffaele\_Sena](https://discuss.elastic.co/u/Raffaele_Sena)
#### Post date: [September 12, 2013, 7:42am UTC](https://discuss.elastic.co/t/sql-interface-to-elasticsearch-aggregation-functions/13563/3 "2013-09-12T07:42:16Z")

</div>

I wrote this in order to run some queries against Elasticsearch used as a  
database (my fault for storing the data in ES instead of MySQL, but it  
worked pretty well)

> **[GitHub - raff/elseql: a SQL-like command line client for elasticsearch](https://github.com/raff/elseql)**
>
> a SQL-like command line client for elasticsearch. Contribute to raff/elseql development by creating an account on GitHub.

(python, but there is an equivalent version in java at  
[GitHub - raff/elseql-j: You know, for Query - java edition](https://github.com/raff/elseql-j))

You can run some aggregate-style queries using facets, and some other by  
using scripts.

-- Raffaele

On Wed, Sep 11, 2013 at 11:54 PM, [sina.tamanna@gmail.com](mailto:sina.tamanna@gmail.com) wrote:

> Elasticsearch is not meant to be RDBM therefore it does not include  
> functionalities available in RDBMs. Perhaps you can explain your use case  
> so that people could show you possible solutions specific for your problem.
> 
> As for the aggregated stuff, take a look at facets[http://www.elasticsearch.org/guide/reference/api/search/facets/](http://www.elasticsearch.org/guide/reference/api/search/facets/)  
> .
> 
> On Wednesday, September 11, 2013 11:00:13 PM UTC+2, pranav amin wrote:
> 
> > Hey guys,
> > 
> > Is there any SQL interface to Elasticsearch? Or if there is any code  
> > written in Perl or python where i can just input my query and it can  
> > provide me the results would be great too.  
> > The output can be in any format as long as i can write a SQL query in the  
> > code.
> > 
> > Also does Elastic search support the below aggregrated -  
> > Sum, Group by, Having, First, Last, etc?
> > 
> > Thanks  
> > Pranav.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 2:17am UTC](https://discuss.elastic.co/t/sql-interface-to-elasticsearch-aggregation-functions/13563/4 "2017-07-06T02:17:00Z")

</div>


