Hi,
I have a following data in ES.
{
"title": "title1 of project",
"organization": "XYZ company"
},
{
"title": "title2 of project",
"organization": "XYZ company"
},
{
"title": "title3 of project",
"organization": "ABC company"
},
I need the count of organizations as follows:
"ABC company":1
"XYZ company": 2
I tried using facets but facets give the count of words
curl -X POST http://localhost:9200/testcompany/activity/_search?pretty=true-d '
{ "query" : {"match_all": {} },
"facets" : {"organization" : {"terms" : {"field": "organization"}}}}'
gives
"facets" : {
"organization" : {
"_type" : "terms",
"missing" : 0,
"total" : 6,
"other" : 0,
"terms" : [ {
"term" : "company",
"count" : 3
}, {
"term" : "xyz",
"count" : 2
}, {
"term" : "abc",
"count" : 1
} ]
}
I have no idea if there are any options which checks for the whole phrase
than words in the facet terms.
Tried searching here and there but couldn't find anything.
Thanks
Anjesh.