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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Matt Weber
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

# API Documentation

# Guide

# Translator

# Examples

--
 
 
Reply | Threaded
Open this post in threaded view
|

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

Benjamin Devèze
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

# API Documentation

# Guide

# Translator

# Examples

--
 
 
Reply | Threaded
Open this post in threaded view
|

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

Shaun Etherton
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

# API Documentation

# Guide

# Translator

# Examples

--
 
 

--
 
 
Reply | Threaded
Open this post in threaded view
|

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

Valentin
In reply to this post by Matt Weber
I love the idea of the translator 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

# API Documentation

# Guide

# Translator

# Examples

--
 
 
Reply | Threaded
Open this post in threaded view
|

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

egaumer
In reply to this post by Matt Weber
As a simple illustration, try translating the following DSL query which implements basic multi-select faceting.

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

# API Documentation

# Guide

# Translator

# Examples

--
 
 
Reply | Threaded
Open this post in threaded view
|

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

Ankur Agarwal
In reply to this post by Matt Weber
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

# API Documentation

# Guide

# Translator

# Examples

--