#NEWLINE# def _facet_counts( items ) : #NEWLINE# #INDENT# 'Returns facet counts as dict.\n\n    Given the `items()` on the raw dictionary from Elasticsearch this processes\n    it and returns the counts keyed on the facet name provided in the original\n    query.\n\n    ' #NEWLINE# facets = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( name , data ) in items : #NEWLINE# #INDENT# facets [ name ] = FacetResult ( name , data ) #NEWLINE# #UNINDENT# return name