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 = workorderid
  • value_field = numhours

from url:

{     "query" : {         "match_all" : {  }     },     "facets" : {         "tag_price_stats" : {             "terms_stats" : {                 "key_field" : "tag",                 "value_field" : "price"             }         }     } } 

hth


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -