Skip to content

Commit

Permalink
Fix #1955: AND -> OR
Browse files Browse the repository at this point in the history
  • Loading branch information
mccalluc committed Aug 1, 2017
1 parent 0b88aa4 commit 24980f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions refinery/ui/source/js/user-file-browser/services/user-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@
params: {
limit: 100, // Default is 100,000. Immutability make it hard in python.
fq: function () {
var operation = ' OR ';
var filters = Object.keys(userFileFiltersService).map(function (key) {
var values = userFileFiltersService[key];
// TODO: escaping!
return values.map(function (value) {
// This clause should be OR, even if the outside is AND
return '(' + key + '_Characteristics_generic_s:"' + value + '"' +
' OR ' + key + '_Factor_Value_s:"' + value + '")';
}).join(' AND ');
}).join(operation);
});
// TODO: Repeated fq params may be more efficient, but not a big deal
return filters.join(' AND ');
return filters.join(operation);
},
sort: function () {
var sort = userFileSortsService.fields.map(function (field) {
Expand Down

0 comments on commit 24980f5

Please sign in to comment.