Hi everyone,

How can i use a variable inside include area? is it possible? how?
I'm using groovy script in my query and it looks like:

GET /my_index/my_type/_search
{
  "_source": false,
  "query": {
    "bool": {
      ...
    }
  },
  "aggs": {
    "group": {
      "nested": {
        "path": "my_path"
      },
      "aggs": {
        "path_id": {
          "terms": {
            "field": "my_path.id",
            "lang": "groovy",
            "script": "def *myVar* = (_value.split('\\\\.').findIndexOf { 
it == '3238175' }+1); *myVar* + '/' + _value; ",
            "include": "*myVar*/.*",
            "size": 0
          }
        }
      }
    }
  }
}

The variable "myVar" is working inside script. Is it possible to use it 
inside include?
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/972dc840-28eb-44c7-be9b-4bb868e660d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to