mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-17 01:00:54 +02:00
merge
This commit is contained in:
@@ -56,10 +56,19 @@ async function searchInContent(data) {
|
||||
}
|
||||
return [];
|
||||
}
|
||||
const [pids, tids] = await Promise.all([
|
||||
doSearch('post', ['posts', 'titlesposts']),
|
||||
doSearch('topic', ['titles', 'titlesposts']),
|
||||
]);
|
||||
let pids = [];
|
||||
let tids = [];
|
||||
const inTopic = String(data.query || '').match(/^in:topic-([\d]+) /);
|
||||
if (inTopic) {
|
||||
const tid = inTopic[1];
|
||||
const cleanedTerm = data.query.replace(inTopic[0], '');
|
||||
pids = await topics.search(tid, cleanedTerm);
|
||||
} else {
|
||||
[pids, tids] = await Promise.all([
|
||||
doSearch('post', ['posts', 'titlesposts']),
|
||||
doSearch('topic', ['titles', 'titlesposts']),
|
||||
]);
|
||||
}
|
||||
|
||||
if (data.returnIds) {
|
||||
return { pids: pids, tids: tids };
|
||||
|
||||
Reference in New Issue
Block a user