# \[ANN\] Elastic.js - Javascript API for ElasticSearch Query DSL and Core Api

**URL:** <https://discuss.elastic.co/t/ann-elastic-js-javascript-api-for-elasticsearch-query-dsl-and-core-api/10357>\
**Category:** Elasticsearch\
**Created:** [January 15, 2013, 5:34pm UTC](https://discuss.elastic.co/t/ann-elastic-js-javascript-api-for-elasticsearch-query-dsl-and-core-api/10357 "2013-01-15T17:34:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattweber](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattweber/32/44940_2.png) [@mattweber](https://discuss.elastic.co/u/mattweber)\
**Post date:** [January 15, 2013, 5:34pm UTC](https://discuss.elastic.co/t/ann-elastic-js-javascript-api-for-elasticsearch-query-dsl-and-core-api/10357/1 "2013-01-15T17:34:41Z")

</div>

FullScale Labs would like to announce Elastic.js which is a JavaScript  
implementation of the ElasticSearch Query DSL and Core API. The goal of the  
project is to provide a JavaScript based DSL similar to the Java  
QueryBuilder/FilterBuilder APIs. This allows us to generate structured  
documentation and provide a more terse syntax.

The code is client/server agnostic so it can be used with node.js, etc.  
There's an interface that allows you to plug in an appropriate client.  
Right now, we have a pure jQuery client as well as Angular.js and node.js  
clients (see the guide).

We've also put together a simple query translator that converts this DSL  
syntax into pure REST requests. This might be useful for constructing more  
sophisticated queries that can then be translated for use via curl or some  
other client library.

The code is up to date with the latest version of ElasticSearch (including  
the latest Lucene 4.0 functionality found in the master branch).

Contributions are welcome.

# Project Home

> **[fullscale/elastic.js](https://github.com/fullscale/elastic.js)**
>
> elastic.js - A JavaScript implementation of the elasticsearch Query DSL

# API Documentation

[http://docs.fullscale.co/elasticjs/](http://docs.fullscale.co/elasticjs/)

# Guide

[http://www.fullscale.co/elasticjs/](http://www.fullscale.co/elasticjs/)

# Translator

[http://docs.fullscale.co/translator](http://docs.fullscale.co/translator)

# Examples

[https://github.com/fullscale/elastic.js/tree/master/examples](https://github.com/fullscale/elastic.js/tree/master/examples)

--

---

<div class="post-metadata">

**Author:** ![Benjamin\_Deveze](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_deveze/32/1577_2.png) [@Benjamin\_Deveze](https://discuss.elastic.co/u/Benjamin_Deveze)\
**Post date:** [January 15, 2013, 10:32pm UTC](https://discuss.elastic.co/t/ann-elastic-js-javascript-api-for-elasticsearch-query-dsl-and-core-api/10357/2 "2013-01-15T22:32:11Z")

</div>

Thanks to share, this seems like a really great job!

On Tuesday, January 15, 2013 6:34:41 PM UTC+1, Matt Weber wrote:

> FullScale Labs would like to announce Elastic.js which is a JavaScript  
> implementation of the Elasticsearch Query DSL and Core API. The goal of the  
> project is to provide a JavaScript based DSL similar to the Java  
> QueryBuilder/FilterBuilder APIs. This allows us to generate structured  
> documentation and provide a more terse syntax.
> 
> The code is client/server agnostic so it can be used with node.js, etc.  
> There's an interface that allows you to plug in an appropriate client.  
> Right now, we have a pure jQuery client as well as Angular.js and node.js  
> clients (see the guide).
> 
> We've also put together a simple query translator that converts this DSL  
> syntax into pure REST requests. This might be useful for constructing more  
> sophisticated queries that can then be translated for use via curl or some  
> other client library.
> 
> The code is up to date with the latest version of Elasticsearch (including  
> the latest Lucene 4.0 functionality found in the master branch).
> 
> Contributions are welcome.
> 
> # Project Home
> 
> [GitHub - fullscale/elastic.js: A JavaScript implementation of the elasticsearch Query DSL](https://github.com/fullscale/elastic.js)
> 
> # API Documentation
> 
> [The domain name Fullscale.co is for sale | Dan.com](http://docs.fullscale.co/elasticjs/)
> 
> # Guide
> 
> [The domain name Fullscale.co is for sale | Dan.com](http://www.fullscale.co/elasticjs/)
> 
> # Translator
> 
> [The domain name Fullscale.co is for sale | Dan.com](http://docs.fullscale.co/translator)
> 
> # Examples
> 
> [https://github.com/fullscale/elastic.js/tree/master/examples](https://github.com/fullscale/elastic.js/tree/master/examples)

--

---

<div class="post-metadata">

**Author:** ![Shaun\_Etherton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaun_etherton/32/2540_2.png) [@Shaun\_Etherton](https://discuss.elastic.co/u/Shaun_Etherton)\
**Post date:** [January 16, 2013, 8:23am UTC](https://discuss.elastic.co/t/ann-elastic-js-javascript-api-for-elasticsearch-query-dsl-and-core-api/10357/3 "2013-01-16T08:23:55Z")

</div>

Hi

Thank you.  
I'm looking forward to using this with nodejs.

Regards--  
Shaun

On Wednesday, 16 January 2013 at 9:02, Benjamin Devèze wrote:

> Thanks to share, this seems like a really great job!
> 
> On Tuesday, January 15, 2013 6:34:41 PM UTC+1, Matt Weber wrote:
> 
> > FullScale Labs would like to announce Elastic.js which is a JavaScript implementation of the Elasticsearch Query DSL and Core API. The goal of the project is to provide a JavaScript based DSL similar to the Java QueryBuilder/FilterBuilder APIs. This allows us to generate structured documentation and provide a more terse syntax.
> > 
> > The code is client/server agnostic so it can be used with node.js, etc. There's an interface that allows you to plug in an appropriate client. Right now, we have a pure jQuery client as well as Angular.js and node.js clients (see the guide).
> > 
> > We've also put together a simple query translator that converts this DSL syntax into pure REST requests. This might be useful for constructing more sophisticated queries that can then be translated for use via curl or some other client library.
> > 
> > The code is up to date with the latest version of Elasticsearch (including the latest Lucene 4.0 functionality found in the master branch).
> > 
> > Contributions are welcome.
> > 
> > # Project Home
> > 
> > [GitHub - fullscale/elastic.js: A JavaScript implementation of the elasticsearch Query DSL](https://github.com/fullscale/elastic.js)
> > 
> > # API Documentation
> > 
> > [The domain name Fullscale.co is for sale | Dan.com](http://docs.fullscale.co/elasticjs/)
> > 
> > # Guide
> > 
> > [The domain name Fullscale.co is for sale | Dan.com](http://www.fullscale.co/elasticjs/)
> > 
> > # Translator
> > 
> > [The domain name Fullscale.co is for sale | Dan.com](http://docs.fullscale.co/translator)
> > 
> > # Examples
> > 
> > [https://github.com/fullscale/elastic.js/tree/master/examples](https://github.com/fullscale/elastic.js/tree/master/examples)
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Valentin\_Pletzer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/valentin_pletzer/32/105548_2.png) [@Valentin\_Pletzer](https://discuss.elastic.co/u/Valentin_Pletzer)\
**Post date:** [January 16, 2013, 2:10pm UTC](https://discuss.elastic.co/t/ann-elastic-js-javascript-api-for-elasticsearch-query-dsl-and-core-api/10357/4 "2013-01-16T14:10:56Z")

</div>

I love the idea of the translator [The domain name Fullscale.co is for sale | Dan.com](http://docs.fullscale.co/translator/#)

a reverse translation would help me to port a existing project.

On Tuesday, January 15, 2013 6:34:41 PM UTC+1, Matt Weber wrote:

> FullScale Labs would like to announce Elastic.js which is a JavaScript  
> implementation of the Elasticsearch Query DSL and Core API. The goal of the  
> project is to provide a JavaScript based DSL similar to the Java  
> QueryBuilder/FilterBuilder APIs. This allows us to generate structured  
> documentation and provide a more terse syntax.
> 
> The code is client/server agnostic so it can be used with node.js, etc.  
> There's an interface that allows you to plug in an appropriate client.  
> Right now, we have a pure jQuery client as well as Angular.js and node.js  
> clients (see the guide).
> 
> We've also put together a simple query translator that converts this DSL  
> syntax into pure REST requests. This might be useful for constructing more  
> sophisticated queries that can then be translated for use via curl or some  
> other client library.
> 
> The code is up to date with the latest version of Elasticsearch (including  
> the latest Lucene 4.0 functionality found in the master branch).
> 
> Contributions are welcome.
> 
> # Project Home
> 
> [GitHub - fullscale/elastic.js: A JavaScript implementation of the elasticsearch Query DSL](https://github.com/fullscale/elastic.js)
> 
> # API Documentation
> 
> [The domain name Fullscale.co is for sale | Dan.com](http://docs.fullscale.co/elasticjs/)
> 
> # Guide
> 
> [The domain name Fullscale.co is for sale | Dan.com](http://www.fullscale.co/elasticjs/)
> 
> # Translator
> 
> [The domain name Fullscale.co is for sale | Dan.com](http://docs.fullscale.co/translator)
> 
> # Examples
> 
> [https://github.com/fullscale/elastic.js/tree/master/examples](https://github.com/fullscale/elastic.js/tree/master/examples)

--

---

<div class="post-metadata">

**Author:** ![egaumer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/egaumer/32/2365_2.png) [@egaumer](https://discuss.elastic.co/u/egaumer)\
**Post date:** [January 16, 2013, 3:23pm UTC](https://discuss.elastic.co/t/ann-elastic-js-javascript-api-for-elasticsearch-query-dsl-and-core-api/10357/5 "2013-01-16T15:23:21Z")

</div>

As a simple illustration, try translating the following DSL query which  
implements basic multi-select faceting.

[http://docs.fullscale.co/translator](http://docs.fullscale.co/translator)

var colors = ejs.TermsFilter('color', ['green', 'red']),  
shapes = ejs.TermsFilter('shape', ['square']),  
tags = ejs.TermsFilter('tags', ['tag2', 'tag4']),  
keywords = ejs.TermsFilter('keywords',['keyword2', 'keyword3'])

ejs.Request()  
.query(ejs.MatchAllQuery())  
.filter(ejs.AndFilter([colors, shapes, tags, keywords]))  
.facet(  
ejs.TermsFacet('shapeFacet')  
.field('shape')  
.allTerms(true)  
.facetFilter(ejs.AndFilter([colors, tags, keywords])))  
.facet(  
ejs.TermsFacet('colorFacet')  
.field('color')  
.allTerms(true)  
.facetFilter(ejs.AndFilter([shapes, tags, keywords])))  
.facet(  
ejs.TermsFacet('tagsFacet')  
.field('tags')  
.allTerms(true)  
.facetFilter(ejs.AndFilter([colors, shapes, keywords])))  
.facet(  
ejs.TermsFacet('keywordsFacet')  
.field('keywords')  
.allTerms(true)  
.facetFilter(ejs.AndFilter([shapes, tags, keywords])))

This generates a pretty gnarly chunk of JSON that would be difficult to  
otherwise construct (and this just uses a simple MatchAllQuery). The DSL  
version is more readable and reusable.

It's an ideal language for exposing the full power of Lucene and  
elasticsearch to domain experts who want/need to execute advanced searches.  
The composable nature also makes it easy to share and extend queries which  
is something we've seen a lot of in scientific related industries.

On Tuesday, January 15, 2013 12:34:41 PM UTC-5, Matt Weber wrote:

> FullScale Labs would like to announce Elastic.js which is a JavaScript  
> implementation of the Elasticsearch Query DSL and Core API. The goal of the  
> project is to provide a JavaScript based DSL similar to the Java  
> QueryBuilder/FilterBuilder APIs. This allows us to generate structured  
> documentation and provide a more terse syntax.
> 
> The code is client/server agnostic so it can be used with node.js, etc.  
> There's an interface that allows you to plug in an appropriate client.  
> Right now, we have a pure jQuery client as well as Angular.js and node.js  
> clients (see the guide).
> 
> We've also put together a simple query translator that converts this DSL  
> syntax into pure REST requests. This might be useful for constructing more  
> sophisticated queries that can then be translated for use via curl or some  
> other client library.
> 
> The code is up to date with the latest version of Elasticsearch (including  
> the latest Lucene 4.0 functionality found in the master branch).
> 
> Contributions are welcome.
> 
> # Project Home
> 
> [GitHub - fullscale/elastic.js: A JavaScript implementation of the elasticsearch Query DSL](https://github.com/fullscale/elastic.js)
> 
> # API Documentation
> 
> [The domain name Fullscale.co is for sale | Dan.com](http://docs.fullscale.co/elasticjs/)
> 
> # Guide
> 
> [The domain name Fullscale.co is for sale | Dan.com](http://www.fullscale.co/elasticjs/)
> 
> # Translator
> 
> [The domain name Fullscale.co is for sale | Dan.com](http://docs.fullscale.co/translator)
> 
> # Examples
> 
> [https://github.com/fullscale/elastic.js/tree/master/examples](https://github.com/fullscale/elastic.js/tree/master/examples)

--

---

<div class="post-metadata">

**Author:** ![Ankur\_Agarwal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankur_agarwal/32/2526_2.png) [@Ankur\_Agarwal](https://discuss.elastic.co/u/Ankur_Agarwal)\
**Post date:** [January 21, 2013, 4:29pm UTC](https://discuss.elastic.co/t/ann-elastic-js-javascript-api-for-elasticsearch-query-dsl-and-core-api/10357/6 "2013-01-21T16:29:12Z")

</div>

Browsed the documentation, seems useful. Thanks for sharing

On Tuesday, 15 January 2013 23:04:41 UTC+5:30, Matt Weber wrote:

> FullScale Labs would like to announce Elastic.js which is a JavaScript  
> implementation of the Elasticsearch Query DSL and Core API. The goal of the  
> project is to provide a JavaScript based DSL similar to the Java  
> QueryBuilder/FilterBuilder APIs. This allows us to generate structured  
> documentation and provide a more terse syntax.
> 
> The code is client/server agnostic so it can be used with node.js, etc.  
> There's an interface that allows you to plug in an appropriate client.  
> Right now, we have a pure jQuery client as well as Angular.js and node.js  
> clients (see the guide).
> 
> We've also put together a simple query translator that converts this DSL  
> syntax into pure REST requests. This might be useful for constructing more  
> sophisticated queries that can then be translated for use via curl or some  
> other client library.
> 
> The code is up to date with the latest version of Elasticsearch (including  
> the latest Lucene 4.0 functionality found in the master branch).
> 
> Contributions are welcome.
> 
> # Project Home
> 
> [GitHub - fullscale/elastic.js: A JavaScript implementation of the elasticsearch Query DSL](https://github.com/fullscale/elastic.js)
> 
> # API Documentation
> 
> [The domain name Fullscale.co is for sale | Dan.com](http://docs.fullscale.co/elasticjs/)
> 
> # Guide
> 
> [The domain name Fullscale.co is for sale | Dan.com](http://www.fullscale.co/elasticjs/)
> 
> # Translator
> 
> [The domain name Fullscale.co is for sale | Dan.com](http://docs.fullscale.co/translator)
> 
> # Examples
> 
> [https://github.com/fullscale/elastic.js/tree/master/examples](https://github.com/fullscale/elastic.js/tree/master/examples)

--

---

<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:55am UTC](https://discuss.elastic.co/t/ann-elastic-js-javascript-api-for-elasticsearch-query-dsl-and-core-api/10357/7 "2017-07-06T02:55:24Z")

</div>


