- // Filter construction implementation taken from
- // https://dev.arvados.org/projects/arvados/repository/entry/apps/workbench/app/assets/javascripts/filterable.js
- // https://dev.arvados.org/projects/arvados/repository/entry/apps/workbench/app/assets/javascripts/to_tsquery.js
- return this.addCondition('any', '@@', value.replace(/[^-\w\.\/]+/g, ' ').trim().replace(/ /g, ':*&'));
+ const regex = /"[^"]*"/;
+ const matches: any[] = [];
+
+ let match = value.match(regex);
+
+ while (match) {
+ value = value.replace(match[0], "");
+ matches.push(match[0].replace(/"/g, ''));
+ match = value.match(regex);
+ }
+
+ const terms = value.trim().split(/(\s+)/).concat(matches);
+ terms.forEach(term => {
+ if (term !== " ") {
+ this.addCondition("any", "ilike", term, "%", "%");
+ }
+ });
+ return this;