https://github.com/codelibs/elasticsearch-lang-handlebars
Handlebars language for Elasticsearch
https://github.com/codelibs/elasticsearch-lang-handlebars
Last synced: 3 months ago
JSON representation
Handlebars language for Elasticsearch
- Host: GitHub
- URL: https://github.com/codelibs/elasticsearch-lang-handlebars
- Owner: codelibs
- Created: 2014-10-10T08:20:55.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-01T07:56:32.000Z (almost 9 years ago)
- Last Synced: 2025-01-28T10:36:55.050Z (5 months ago)
- Language: Java
- Homepage:
- Size: 33.2 KB
- Stars: 2
- Watchers: 9
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Elasticsearch Handlebars Lang Plugin
=======================## Overview
This plugin add Handlebars language to Elasticsearch.
## Version
| Version | Elasticsearch |
|:---------:|:-------------:|
| master | 2.4.X |
| 2.4.0 | 2.4.0 |
| 2.3.0 | 2.3.1 |
| 2.2.0 | 2.2.2 |
| 1.4.1 | 1.4.0 |### Issues/Questions
Please file an [issue](https://github.com/codelibs/elasticsearch-lang-handlebars/issues "issue").
(Japanese forum is [here](https://github.com/codelibs/codelibs-ja-forum "here").)## Installation
### Install Handlebars Language Plugin
$ $ES_HOME/bin/plugin install org.codelibs/elasticsearch-lang-handlebars/2.4.0
## References
This plugin supports an executable script language(search script is not supported).
### Using on Script-based Search Template
Using [Script-based Search Template](https://github.com/codelibs/elasticsearch-sstmpl "Script-based Search Template") Plugin, you can search by Handlebars template.
GET /_search/template
{
"lang": "handlebars",
"template": "{\"query\": {\"match\": {\"title\": \"{{query_string}}\"}}}",
"params": {
"query_string": "search for these words"
}
}### How to Register Helpers
To register your helper, put .js file to $ES_HOME/config/helpers.
$ echo "Handlebars.registerHelper('foobar', function (context) { return \"foobar\";})" > $ES_HOME/config/helpers/foobar.js