Items without rows in the applicable table didn't show up for searches with isNot or doesNotContain conditions
This commit is contained in:
parent
04d05548b2
commit
d193afe740
1 changed files with 10 additions and 11 deletions
|
@ -289,7 +289,14 @@ Scholar.Search.prototype._buildQuery = function(){
|
|||
case 'savedSearches':
|
||||
break;
|
||||
default:
|
||||
condSQL += 'itemID IN (SELECT itemID FROM ' + i + ' WHERE (';
|
||||
condSQL += 'itemID '
|
||||
switch (tables[i][j]['operator']){
|
||||
case 'isNot':
|
||||
case 'doesNotContain':
|
||||
condSQL += 'NOT ';
|
||||
break;
|
||||
}
|
||||
condSQL += 'IN (SELECT itemID FROM ' + i + ' WHERE (';
|
||||
openParens = 2;
|
||||
}
|
||||
|
||||
|
@ -366,25 +373,17 @@ Scholar.Search.prototype._buildQuery = function(){
|
|||
condSQL += tables[i][j]['field'];
|
||||
switch (tables[i][j]['operator']){
|
||||
case 'contains':
|
||||
case 'doesNotContain': // excluded with NOT IN above
|
||||
condSQL += ' LIKE ?';
|
||||
condSQLParams.push('%' + tables[i][j]['value'] + '%');
|
||||
break;
|
||||
|
||||
case 'doesNotContain':
|
||||
condSQL += ' NOT LIKE ?';
|
||||
condSQLParams.push('%' + tables[i][j]['value'] + '%');
|
||||
break;
|
||||
|
||||
case 'is':
|
||||
case 'isNot': // excluded with NOT IN above
|
||||
condSQL += '=?';
|
||||
condSQLParams.push(tables[i][j]['value']);
|
||||
break;
|
||||
|
||||
case 'isNot':
|
||||
condSQL += '!=?';
|
||||
condSQLParams.push(tables[i][j]['value']);
|
||||
break;
|
||||
|
||||
case 'greaterThan':
|
||||
condSQL += '>?';
|
||||
condSQLParams.push({int:tables[i][j]['value']});
|
||||
|
|
Loading…
Add table
Reference in a new issue