from_dict is a static method, which resulted in the set index being ignored
@@ -105,12 +105,16 @@ def get_providers(index):
}
}
}
- s = Search(index=index).from_dict(agg_body)
+ s = Search.from_dict(agg_body)
+ s = s.index(index)
results = s.execute().aggregations['unique_providers']['buckets']
providers = {result['key']: result['doc_count'] for result in results}
- cache.set(key=provider_cache_name,
+ cache.set(
+ key=provider_cache_name,
timeout=CACHE_TIMEOUT,
- value=providers)
+ value=providers
+ )
+ print()
return providers
