Occurance per another field

It has nothing to do with terms stats. You can't do this with elasticsearch.

On Tue, Nov 8, 2011 at 10:22 AM, Vineeth Mohan vineethmohan@algotree.comwrote:

Hi ,

I have documents which are described in the

GIST - gist:1347280 · GitHub

In each document i have many companies. (Which i am putting in companies
list)
For each company i have attributes tag with values like "software" ,
"product" , "service" ... etc

When a search hits , i want to know which all companies are included in
the search (This can be done using term facets)
Now under each company , i want to know its tags.

Eg: Now when a query hit , the facet result should be something like

comapy : [ { name : yahoo , hits : 3 , tags : [ internet , software ,
product ] } ,
{ name : IBM , hits : 2 , tags : [ software , service ]}]

I figured out it has something to do with term_stat , but am not getting
it to work.

Can someone give an insight on this.

Thanks
Vineeth