You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
results.aggregations.top_names.eachdo |bucket|
end# instead of results.aggregations.top_names.buckets.each
Keyed hash
results.aggregations.top_names.inject({}){ |h,d| h[d["key"]]=d["doc_count"];h}# => {"Aeroflot"=>179,"Military - U.S. Air Force"=>176,"Air France"=>70,"Deutsche Lufthansa"=>65,"Air Taxi"=>44,"China National Aviation Corporation"=>44,"United Air Lines"=>44,"Military - U.S. Army Air Forces"=>43,"Pan American World Airways"=>41,"American Airlines"=>36}
Dig
results.aggregations.dig(:top_names,:fatalities)
The text was updated successfully, but these errors were encountered:
enable things like iterating over buckets
Iterators
Keyed hash
Dig
The text was updated successfully, but these errors were encountered: