Fixed searching by tag in slot fillers
This commit is contained in:
@@ -41,16 +41,21 @@ Meteor.publish('slotFillers', function (slotId, searchTerm, isDummySlot) {
|
|||||||
sort: { name: 1 }
|
sort: { name: 1 }
|
||||||
});
|
});
|
||||||
|
|
||||||
// Build a filter for nodes in those libraries that match the slot
|
|
||||||
let filter = getSlotFillFilter({ slot, libraryIds });
|
|
||||||
this.autorun(function () {
|
this.autorun(function () {
|
||||||
|
// Build a filter for nodes in those libraries that match the slot
|
||||||
|
let filter = getSlotFillFilter({ slot, libraryIds });
|
||||||
// Get the limit of the documents the user can fetch
|
// Get the limit of the documents the user can fetch
|
||||||
var limit = self.data('limit') || 50;
|
var limit = self.data('limit') || 50;
|
||||||
check(limit, Number);
|
check(limit, Number);
|
||||||
|
|
||||||
let options = undefined;
|
let options = undefined;
|
||||||
if (searchTerm) {
|
if (searchTerm) {
|
||||||
filter.name = { $regex: escapeRegex(searchTerm), '$options': 'i' };
|
filter.$and.push({
|
||||||
|
$or: [
|
||||||
|
{ name: { $regex: escapeRegex(searchTerm), '$options': 'i' } },
|
||||||
|
{ libraryTags: searchTerm }
|
||||||
|
]
|
||||||
|
});
|
||||||
//filter.$text = { $search: searchTerm };
|
//filter.$text = { $search: searchTerm };
|
||||||
options = {
|
options = {
|
||||||
// relevant documents have a higher score.
|
// relevant documents have a higher score.
|
||||||
|
|||||||
Reference in New Issue
Block a user