faceted search - elasticsearch: is it possible to order aggregations? -
can add weight each aggregation make sure return in order, example: category, manufacturer, color instead of in order shown below:
{ "aggs": { "category": { "terms": { "field": "category" } }, "manufacturer": { "terms": { "field": "manufacturer" } }, "color": { "terms": { "field": "color" } } } } // results "color": { "buckets": [ ... ] } "category": { "buckets": [ ... ] } "manufacturer": { "buckets": [ ... ] }
can add weight each aggregation make sure return in order, example: category, manufacturer, color instead of in order shown below
the response json , json/javascript object keys order undefined.
source: http://www.json.org/
an object unordered set of name/value pairs.
Comments
Post a Comment