better-search: use cutForSearch

This commit is contained in:
undefined committed 2020-09-06 15:28:45 +08:00
1 parent f75c12f4bd
commit dbc5fff09f
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ export const description = 'Ensure index for peoblem search';
export async function run() {
await document.coll.find({ docType: document.TYPE_PROBLEM }).forEach(async (doc: Pdoc) => {
const segments = nodejieba.cut(doc.title);
const segments = nodejieba.cutForSearch(doc.title);
await document.coll.updateOne({ _id: doc._id }, { $set: { search: segments.join(' ') } });
});
}