mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
better-search: use cutForSearch
This commit is contained in:
1 parent
f75c12f4bd
commit
dbc5fff09f
3 files changed
+4
-4
No files matched your search
@@ -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(' ') } });
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user