Basis auf der official document, scheint es wie kann nur auf die Single-Bucket-Aggregation sortieren. Wie kann ich die Ergebnisse nach 'avg' in der Anzahl der Buckets aggregieren?Wie kann ich Aggregations-Buckets nach metrischen Ergebnissen sortieren?
Ich fügte 'Auftrag' in 'result_1' noch nicht arbeiten hinzu. Es zeigt Fehler unter:
TransportError(500, u'search_phase_execution_exception')
Invalid terms aggregation order path [reverse>condi_range>statistic_score.avg].
Terms buckets can only be sorted on a sub-aggregator path that is built out of zero or more single-bucket aggregations within the path and a final single-bucket or a metrics aggregation at the path end.
Sub-path [reverse>condi_range] points to non single-bucket aggregation')
Der entscheidende Punkt ist, dass i den Bereich begrenzen, muss auf ‚float_field‘ und die range aggregation ist eine andere Eimer Aggregation.
Hat jemand eine Idee?
Danke!
Codebeispiel:
{
"aggs": {
"condi_nested": {
"aggs": {
"filtered": {
"filter": {
"bool": {}
},
"aggs": {
"result_1": {
"terms": {
"field": "Foo",
"size": 100000000,
"order": {
"reverse>condi_range>statistic_score.avg": "desc"
}
},
"aggs": {
"reverse": {
"aggs": {
"condi_range": {
"range": {
"ranges": [
{
"to": 100,
"from": 0
}
],
"field": "float_field"
},
"aggs": {
"percentile_score": {
"percentiles": {
"field": "float_field"
}
},
"statistic_score": {
"extended_stats": {
"field": "float_field"
}
}
}
}
},
"reverse_nested": {}
}
}
}
}
}
},
"nested": {
"path": "nested_path_of_Foo"
}
}
}
}