Fixed search for library prop not using tags
This commit is contained in:
@@ -86,7 +86,13 @@ Meteor.publish('searchLibraryNodes', function (creatureId) {
|
|||||||
|
|
||||||
let options = undefined;
|
let options = undefined;
|
||||||
if (searchTerm) {
|
if (searchTerm) {
|
||||||
filter.name = { $regex: escapeRegex(searchTerm), '$options': 'i' };
|
// Regex search instead of text index
|
||||||
|
filter.$and = [{
|
||||||
|
$or: [
|
||||||
|
{ name: { $regex: escapeRegex(searchTerm), '$options': 'i' } },
|
||||||
|
{ libraryTags: searchTerm },
|
||||||
|
],
|
||||||
|
}];
|
||||||
// filter.$text = {$search: searchTerm};
|
// filter.$text = {$search: searchTerm};
|
||||||
options = {
|
options = {
|
||||||
/*
|
/*
|
||||||
@@ -105,7 +111,7 @@ Meteor.publish('searchLibraryNodes', function (creatureId) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//delete filter.$text
|
//delete filter.$text
|
||||||
delete filter.name;
|
delete filter.$and;
|
||||||
options = {
|
options = {
|
||||||
sort: {
|
sort: {
|
||||||
'ancestors.0.id': 1,
|
'ancestors.0.id': 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user