mirror of
https://github.com/wekan/wekan.git
synced 2026-02-25 17:34:07 +01:00
Global search development
* Add text query ability * limit results to 50 * display results count
This commit is contained in:
parent
34000ad159
commit
2e17f2b4b9
3 changed files with 18 additions and 2 deletions
|
|
@ -1798,6 +1798,16 @@ Cards.globalSearch = queryParams => {
|
|||
}
|
||||
}
|
||||
|
||||
if (queryParams.text) {
|
||||
const regex = new RegExp(queryParams.text, 'i');
|
||||
|
||||
selector.$or = [
|
||||
{ title: regex },
|
||||
{ description: regex },
|
||||
{ customFields: { $elemMatch: { value: regex } } },
|
||||
];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('selector:', selector);
|
||||
return Cards.find(selector, {
|
||||
|
|
@ -1815,6 +1825,7 @@ Cards.globalSearch = queryParams => {
|
|||
colors: 1,
|
||||
dueAt: 1,
|
||||
},
|
||||
limit: 50,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue