Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debugging groovy script elasticsearch

How is it possible to print or log some variables using a groovy script for scoring? I know there are log directories, but they don't log what I print in the script.

like image 251
Jayni Avatar asked Aug 18 '14 10:08

Jayni


1 Answers

Ok, as you said, Here is my way of doing so.

curl -XPOST "http://localhost:9200/index/type/_search" -d'
{
    "size": 1, 
    "script_fields": {
       "toTestField": {
          "script": "_source.field_name.equals('key')? true : false "
       }
    }

}'

Change the script and Check the value of toTestField in response,

I think it is easy way to debug.

like image 101
progrrammer Avatar answered Oct 21 '22 09:10

progrrammer