Skip to content

codelibs/elasticsearch-lang-velocity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elasticsearch Velocity Lang Plugin

Overview

This plugin add Velocity language to Elasticsearch.

Version

Versions in Maven Repository

Issues/Questions

Please file an issue.

Installation

$ $ES_HOME/bin/elasticsearch-plugin install org.codelibs:elasticsearch-lang-velocity:7.6.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 Plugin, you can search by Velocity template.

GET /_search/script_template
{
    "lang": "velocity",
    "inline": "{\"query\": {\"match\": {\"title\": \"${query_string}\"}}}",
    "params": {
        "query_string": "search for these words"
    }
}

Where is a root directory for Velocity's template

The directory is ${es.config}/scripts. The file extension for Velocity's template is .vm or .velocity.

Use Template Cache

To use a template cache for Velocity template, please prepend "##cache" to the template file.