@@ -69,23 +69,23 @@ def __init__(self, **kwargs):
6969 if not hasattr (self , "request_tiemout" ):
7070 self .request_tiemout = 15
7171
72- for position , geo_bound_term in enumerate (self . geo_bounds ):
72+ for position , geo_bound_term in enumerate (getattr ( self , " geo_bounds" , []) ):
7373 if "name" not in geo_bound_term :
7474 self .geo_bounds [position ]["name" ] = geo_bound_term ["key" ]
7575
76- for position , min_term in enumerate (self . min ):
76+ for position , min_term in enumerate (getattr ( self , " min" , []) ):
7777 if "name" not in min_term :
7878 self .min [position ]["name" ] = min_term ["key" ]
7979
80- for position , max_term in enumerate (self . max ):
80+ for position , max_term in enumerate (getattr ( self , " max" , []) ):
8181 if "name" not in max_term :
8282 self .max [position ]["name" ] = max_term ["key" ]
8383
84- for position , sum_term in enumerate (self . sum ):
84+ for position , sum_term in enumerate (getattr ( self , " sum" , []) ):
8585 if "name" not in sum_term :
8686 self .sum [position ]["name" ] = sum_term ["key" ]
8787
88- for position , list_term in enumerate (self . list ):
88+ for position , list_term in enumerate (getattr ( self , " list" , []) ):
8989 if "name" not in list_term :
9090 self .list [position ]["name" ] = list_term ["key" ]
9191
@@ -147,7 +147,7 @@ def extract_facet(self, facets: list):
147147 elif "bounds" in self .aggregations [facet ["name" ]].keys ():
148148 value = self .aggregations [facet ["name" ]]["bounds" ]
149149
150- else :
150+ elif "value" in self . aggregations [ facet [ "name" ]]. keys () :
151151 value = self .aggregations [facet ["name" ]]["value" ]
152152
153153 self .metadata [facet ["name" ]] = value
0 commit comments