I need to present the list of organizations (name and ids) with their
numbers like
ABC company (11a): 2
XYX company (12c): 1
If i do facet for id,
curl -X POST localhost:9200/testcompany/activity1/_search?pretty=true -d '{
"query" : {"match_all":{}},
"facets" : {"organization" : {"terms" : {"field": "organization.id"}}}
}'
I only get count by "ids" and using name, i get count by "names". What i
could do is get the count by ids and names and combine results, which is
definitely not a good way. Is there any possiblity of getting the unique
json results for organizations so that i could easily combine the facets
results with the sort of key-value unique results.
This might not work properly, as I might be missing something on the
necessary syntax for nested type, as is your data, but it works plain and
simple in my case.
On Sunday, May 6, 2012 3:26:43 PM UTC+5:30, anjesh wrote:
I need to present the list of organizations (name and ids) with their
numbers like
ABC company (11a): 2
XYX company (12c): 1
If i do facet for id,
curl -X POST localhost:9200/testcompany/activity1/_search?pretty=true -d '{
"query" : {"match_all":{}},
"facets" : {"organization" : {"terms" : {"field": "organization.id"}}}
}'
I only get count by "ids" and using name, i get count by "names". What i
could do is get the count by ids and names and combine results, which is
definitely not a good way. Is there any possiblity of getting the unique
json results for organizations so that i could easily combine the facets
results with the sort of key-value unique results.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.