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
Implementer /facets/all/<field> pour avoir des stats toutes collections confondues
Une fonction pour fusionner les résultats de get_field_values(collection, field) :
defmerge_values(values_list):
"""Take a list of result from get_field_values and merge them into one response sorted by doc_count """total= {}
forvaluesinvalues_list:
forvalueinvalues:
v=total.setdefault(value["key"].capitalize(), {
"key": value["key"],
"doc_count": 0,
})
v["doc_count"] +=value["doc_count"]
total_list=list(total.values())
total_list.sort(key=lambdavalue:value["doc_count"], reverse=True)
returntotal_list
The text was updated successfully, but these errors were encountered:
Implementer
/facets/all/<field>
pour avoir des stats toutes collections confonduesUne fonction pour fusionner les résultats de
get_field_values(collection, field)
:The text was updated successfully, but these errors were encountered: