Term value in terms_stats facet?

Hi,

it is possible to get value of particular term in stats_value facet when
using value_script?

Something like the following:

"facet" : {
"terms_stats" : {
"key_field" : "some_multivalue_field",
"value_script" : "term.length",
"lang" : "js"
}
}

I am getting EcmaError: "term" is not defined.

Regards,
Lukas

No, you can't access the term value, its not available to the script. If it
wasn't a multi field, you could have simply accessed it through the script,
but since its multi field, it makes less sense to do it...

On Fri, Oct 7, 2011 at 1:05 AM, Lukáš Vlček lukas.vlcek@gmail.com wrote:

Hi,

it is possible to get value of particular term in stats_value facet when
using value_script?

Something like the following:

"facet" : {
"terms_stats" : {
"key_field" : "some_multivalue_field",
"value_script" : "term.length",
"lang" : "js"
}
}

I am getting EcmaError: "term" is not defined.

Regards,
Lukas