This project is a simply way create query to run in index without writer queries using libraries API client Elasticsearch.
- Java 17
- Elasticsearch
- HandlerBars
HandlerBars is a library that through a template and an input object generates an output in text format. In our project we use a query template from Elasticsearch and with the mustache template we can manipulate query parameters dynamically without the need to write code.
Template:
{
"size": {{ size }},
"query":{
"match": {
"title": "{{ term }}"
}
}
}
Output:
{
"size": 10,
"query":{
"match": {
"title": "batman"
}
}
}
For more information handlerBars.