|
@@ -536,28 +536,28 @@ def augment_solr_response(response, collection, query):
|
|
|
|
|
|
|
|
def _augment_pivot_2d(counts):
|
|
def _augment_pivot_2d(counts):
|
|
|
values = set()
|
|
values = set()
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
for dimension in counts:
|
|
for dimension in counts:
|
|
|
for pivot in dimension['pivot']:
|
|
for pivot in dimension['pivot']:
|
|
|
values.add(pivot['value'])
|
|
values.add(pivot['value'])
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
values = sorted(list(values))
|
|
values = sorted(list(values))
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
augmented = []
|
|
augmented = []
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
for dimension in counts:
|
|
for dimension in counts:
|
|
|
count = {}
|
|
count = {}
|
|
|
for pivot in dimension['pivot']:
|
|
for pivot in dimension['pivot']:
|
|
|
count[pivot['value']] = pivot['count']
|
|
count[pivot['value']] = pivot['count']
|
|
|
for val in values:
|
|
for val in values:
|
|
|
- if val in count:
|
|
|
|
|
- c = {"count": count[pivot['value']], "value": val, "cat": dimension['value']}
|
|
|
|
|
|
|
+ if val in count:
|
|
|
|
|
+ c = {"count": count[val], "value": val, "cat": dimension['value']}
|
|
|
else:
|
|
else:
|
|
|
c = {"count": 0, "value": val, "cat": dimension['value']}
|
|
c = {"count": 0, "value": val, "cat": dimension['value']}
|
|
|
augmented.append(c)
|
|
augmented.append(c)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return augmented
|
|
return augmented
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
def augment_solr_exception(response, collection):
|
|
def augment_solr_exception(response, collection):
|
|
|
response.update(
|
|
response.update(
|