Elasticsearch order responses and then facet -
is possible order responses field , apply faceting? app contains workorder documents , activity log entries. employees log time spent working on workorder creating activity log entries in separate documents associated workorder document. i'd able query es , have return activity log entries ordered workorderid , compute stats facet against activity log entries each workorder.
from gather (glanced @ gist) don't need info workorder-docs fullfill query right? i.e: data need exists in activity-docs.
if understand question correctly can use terms-stats-field http://www.elasticsearch.org/guide/reference/api/search/facets/terms-stats-facet/
whereby specify:
key_field
= workorderidvalue_field
= numhours
from url:
{ "query" : { "match_all" : { } }, "facets" : { "tag_price_stats" : { "terms_stats" : { "key_field" : "tag", "value_field" : "price" } } } }
hth
Comments
Post a Comment