7

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.

1
  • For testing if my algorithm work correcty. Or I better say it doesn't and I don't know why. I need to have a look at the variables which I obtain. Commented Aug 18, 2014 at 18:46

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you. It isn't the easiest way. I expectet it to be simpler, but it will work.
Yaa, I do it like this, And I feel easy doing this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.