Last active
August 29, 2015 13:57
-
-
Save bly2k/9468905 to your computer and use it in GitHub Desktop.
Elasticsearch external mvel script example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1: | |
Under the config/scripts folder, create a file named helloworld.mvel | |
Step 2: | |
Edit the file helloworld.mvel and put this and save: | |
"hello world" | |
Step 3: | |
Restart Elasticsearch | |
Step 4: | |
Test the script using a query like this: | |
curl -XPOST 'localhost:9200/test1/doc' -d '{ "test": "test" }' | |
curl 'localhost:9200/test1/_search?pretty' -d '{ | |
"script_fields": { | |
"test": { | |
"script": "helloworld" | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment