use case insensitive search.
This commit is contained in:
@@ -81,9 +81,9 @@ class AdvancedSearchQuery {
|
||||
// };
|
||||
// filter2.push({ file: { '$elemMatch': filter3 } });
|
||||
filter2.push({ 'file.file_type_name': fileType });
|
||||
filter2.push({ ['file.' + subKey]: { '$regex': regex } });
|
||||
filter2.push({ ['file.' + subKey]: { '$regex': [regex, 'i'] } });
|
||||
} else {
|
||||
filter2.push({ [key]: { '$regex': regex } });
|
||||
filter2.push({ [key]: { '$regex': [regex, 'i'] } });
|
||||
}
|
||||
});
|
||||
filter.push({ '$and': filter2 });
|
||||
|
||||
@@ -556,7 +556,7 @@ class ItemUtil {
|
||||
let nKeys: string[] = basicNumKeys.concat(numKeys);
|
||||
sKeys.forEach((key) => {
|
||||
let criteria: any = {};
|
||||
criteria[key] = { '$regex': regex };
|
||||
criteria[key] = { '$regex': [regex, 'i'] };
|
||||
filterItemType['$or'].push(criteria);
|
||||
});
|
||||
if (num !== null) {
|
||||
@@ -569,8 +569,8 @@ class ItemUtil {
|
||||
filter['$or'].push(filterItemType);
|
||||
}
|
||||
if (type === 'basic') {
|
||||
filter['$or'].push({ 'title': { '$regex': regex } });
|
||||
filter['$or'].push({ 'keyword': { '$regex': regex } });
|
||||
filter['$or'].push({ 'title': { '$regex': [regex, 'i'] } });
|
||||
filter['$or'].push({ 'keyword': { '$regex': [regex, 'i'] } });
|
||||
} else {
|
||||
if (type === 'all' || type === 'binder') {
|
||||
const strKeys: string[] = ['doi', 'title', 'keyword', 'description'];
|
||||
|
||||
Reference in New Issue
Block a user