elastic.js

A JavaScript implementation of the elasticsearch Query DSL

  • Owner: fullscale/elastic.js
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

elastic.js

A JavaScript implementation of the ElasticSearch DSL for use with the official elasticsearch javascript client.

Documentation

You can find the official documentation at the following locations:

You will also be able to find unofficial documentation and examples on on our
blog and GitHub Gist pages here
and here.

Examples

See http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search.

client.search({
  index: 'myindex',
  body: ejs.Request()
          .query(ejs.MatchQuery('title', 'test'))
          .facet(ejs.TermsFacet('tags').field('tags'))
}, function (error, response) {
  // handle response
});

Suggest

See http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-suggest

client.suggest({
  index: 'myindex',
  body: ejs.TermSuggester('mysuggester')
          .text('tset')
          .field('title')
}, function (error, response) {
  // handle suggestion response
});

See http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch

client.msearch({
  body: [
    {}
    ejs.Request().query(ejs.MatchAllQuery()),
    { index: 'myindex', type: 'mytype' },
    ejs.Request().query(ejs.QueryStringQuery('"Test 1"'))
  ]
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Also, please don't edit elastic.js and elastic.min.js files as they are generated via grunt. You'll find source code in the "src" subdirectory!

License

Copyright (c) 2012-2014 FullScale Labs, LLC
Licensed under the MIT license.

Main metrics

Overview
Name With Ownerfullscale/elastic.js
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 3)
Platform
License:MIT License
所有者活动
Created At2012-11-15 16:33:54
Pushed At2018-05-08 16:20:24
Last Commit At2014-10-13 13:55:01
Release Count2
Last Release Name1.2.0 (Posted on )
First Release Name1.1.1 (Posted on 2013-05-24 15:02:38)
用户参与
Stargazers Count652
Watchers Count34
Fork Count163
Commits Count355
Has Issues Enabled
Issues Count74
Issue Open Count19
Pull Requests Count7
Pull Requests Open Count13
Pull Requests Close Count16
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private