Is it possible to access a variable inside the include area?

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 elasticsearch+unsubscribe@googlegroups.com.
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.

I have solved with RegEx

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": "[1-4]/.*",
"size": 0
}
}
}
}
}
}

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d943e0e8-066c-4db0-89e0-75d8fbaf34e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.