Skip to content

Commit

Permalink
Merge pull request #1029 from aholachek/object-filter
Browse files Browse the repository at this point in the history
moved filter label processing to the correct function, added logic to…
  • Loading branch information
aholachek authored Jul 20, 2016
2 parents 4ab2200 + 1bb3d46 commit 179a331
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/js/widgets/filter_visualizer/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,8 @@ define([
}
}, this);

//clean up for hierarchical facets (remove parents)
filters.forEach(function(filt){
filt.filter_value = filt.filter_value.map(function(facet){
return facet.replace(/1\/[^/]+\//, '');
});
});



// finally sort them by preference/ remove unknown
filters = _.sortBy(filters, function(x) {
Expand Down Expand Up @@ -262,6 +258,7 @@ define([
**/
prepareGUIData: function(filters) {


if (this.withoutOperators)
return this._prepareGUIDataWithoutOperators(filters);

Expand Down Expand Up @@ -376,6 +373,8 @@ define([
while (s.indexOf('(') == 0 && s.indexOf(')') == s.length-1) {
s = s.substr(1, s.length-2);
}
//remove 0/ and 0/fghfgh1/ for hierarchical facets
s = s.replace(/0\/|1\/[^/]+\//, '');

// replace fields
switch (filter_name) {
Expand Down

0 comments on commit 179a331

Please sign in to comment.