Multi term faceting on multiple field by 'AND' instead of 'OR'

Hi,
I need to get count of two field. I gues, I need a term facet which should
correspond to SQL part which is like "group by field1,field2". I saw the
elasticsearch multi field term facet examples but it is not what I look
for. Because it is faceting on fields as seperated. I read a related
question which is at
https://groups.google.com/forum/?fromgroups=#!topic/elasticsearch/7NwoiR87Tuw before.
There is a suggestion about scripting. I might have misunderstood but if
this is the solution how can I do it with scripting or is there another way
to get count of two field together ?

Thank you.

--

Here is an example of how to do it with
scripting https://gist.github.com/4568750

On Friday, January 18, 2013 4:26:17 AM UTC-5, Whispered wrote:

Hi,
I need to get count of two field. I gues, I need a term facet which should
correspond to SQL part which is like "group by field1,field2". I saw the
elasticsearch multi field term facet examples but it is not what I look
for. Because it is faceting on fields as seperated. I read a related
question which is at
https://groups.google.com/forum/?fromgroups=#!topic/elasticsearch/7NwoiR87Tuw before.
There is a suggestion about scripting. I might have misunderstood but if
this is the solution how can I do it with scripting or is there another way
to get count of two field together ?

Thank you.

--

Igor,

Any performance implications of using this approach?

Thank you,
Alex

On Friday, January 18, 2013 4:28:46 PM UTC-5, Igor Motov wrote:

Here is an example of how to do it with scripting
https://gist.github.com/4568750

On Friday, January 18, 2013 4:26:17 AM UTC-5, Whispered wrote:

Hi,
I need to get count of two field. I gues, I need a term facet which
should correspond to SQL part which is like "group by field1,field2". I
saw the elasticsearch multi field term facet examples but it is not what I
look for. Because it is faceting on fields as seperated. I read a
related question which is at
https://groups.google.com/forum/?fromgroups=#!topic/elasticsearch/7NwoiR87Tuw before.
There is a suggestion about scripting. I might have misunderstood but if
this is the solution how can I do it with scripting or is there another way
to get count of two field together ?

Thank you.

--

It's going to be slow. This script will be executed for every single record
in the results list. That's why indexing this two fields together would be
a faster solution as it was already mentioned in the linked discussion.

On Sunday, January 20, 2013 5:02:52 PM UTC-5, AlexR wrote:

Igor,

Any performance implications of using this approach?

Thank you,
Alex

On Friday, January 18, 2013 4:28:46 PM UTC-5, Igor Motov wrote:

Here is an example of how to do it with scripting
https://gist.github.com/4568750

On Friday, January 18, 2013 4:26:17 AM UTC-5, Whispered wrote:

Hi,
I need to get count of two field. I gues, I need a term facet which
should correspond to SQL part which is like "group by field1,field2". I
saw the elasticsearch multi field term facet examples but it is not what I
look for. Because it is faceting on fields as seperated. I read a
related question which is at
https://groups.google.com/forum/?fromgroups=#!topic/elasticsearch/7NwoiR87Tuw before.
There is a suggestion about scripting. I might have misunderstood but if
this is the solution how can I do it with scripting or is there another way
to get count of two field together ?

Thank you.

--