Kaynağa Gözat

HUE-7501 [dashboard] Aggregate field does not exist in older samples

Romain Rigaux 8 yıl önce
ebeveyn
işleme
f48f12d

+ 1 - 1
desktop/libs/dashboard/src/dashboard/static/dashboard/js/search.ko.js

@@ -692,7 +692,7 @@ var Collection = function (vm, collection) {
   }
 
   self._addObservablesToFacet = function(facet, vm) {
-    if (facet.properties.facets_form) { // Only Solr 5+
+    if (facet.properties.facets_form && facet.properties.facets_form.aggregate) { // Only Solr 5+
       facet.properties.facets_form.aggregate.metrics = ko.computed(function() {
         var _field = self.getTemplateField(facet.widgetType() == 'hit-widget' ? facet.field() : facet.properties.facets_form.field(), self.template.fieldsAttributes());
         return self._get_field_operations(_field, facet);