Group by operation on two field with term_stat facet

I asked a question similar with this topic before. It was about group by on
two field with term stat by scripting. Igor Motov ansered my question
(thank him.). The query is like;

"facets": {

    "test": {

        "terms": {

            "script": {

                "script_field" : "doc[\"foo\"].value+\"-\"+doc[\"bar\"].value"

            }

        }

    }

}

The term part of term_stat facet is key_field and the statistical part of
term_stat is value_field if I didn't misunderstand. value_field can be
value_script. Hence we can include our custom scripts. But when I need to
group by operation on two field I should do it with key_field which
represents term facet. But there is no key_script property which provide
group by operation on multiple field, in term_stat. Actually I couldn't
find this. Is there a way to define key_field as key_script to make group
by operation on two field or can ES support this.

Thank You!

--

Unfortunately, that's current limitation of terms_stats. I would advise
again :wink: to just index this pair as a field.

On Wednesday, January 23, 2013 9:43:10 AM UTC-5, Whispered wrote:

I asked a question similar with this topic before. It was about group by
on two field with term stat by scripting. Igor Motov ansered my question
(thank him.). The query is like;

"facets": {

    "test": {

        "terms": {

            "script": {

                "script_field" : "doc[\"foo\"].value+\"-\"+doc[\"bar\"].value"

            }

        }

    }

}

The term part of term_stat facet is key_field and the statistical part of
term_stat is value_field if I didn't misunderstand. value_field can be
value_script. Hence we can include our custom scripts. But when I need to
group by operation on two field I should do it with key_field which
represents term facet. But there is no key_script property which provide
group by operation on multiple field, in term_stat. Actually I couldn't
find this. Is there a way to define key_field as key_script to make group
by operation on two field or can ES support this.

Thank You!

--
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.
For more options, visit https://groups.google.com/groups/opt_out.