mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
优化中文搜索
This commit is contained in:
1 parent
f2f0212947
commit
6eed519407
11 files changed
+91
-9
No files matched your search
@@ -61,10 +61,11 @@ export function get(domainId: string, docType: number, docId: DocID) {
|
||||
return coll.findOne({ domainId, docType, docId });
|
||||
}
|
||||
|
||||
export async function set(domainId: string, docType: number, docId: DocID, args: any) {
|
||||
export async function set(domainId: string, docType: number, docId: DocID, $set: any) {
|
||||
await bus.parallel('document/set', domainId, docType, docId, $set);
|
||||
const res = await coll.findOneAndUpdate(
|
||||
{ domainId, docType, docId },
|
||||
{ $set: args },
|
||||
{ $set },
|
||||
{ returnOriginal: false, upsert: true },
|
||||
);
|
||||
return res.value;
|
||||
@@ -339,7 +340,7 @@ async function ensureIndexes() {
|
||||
await ic({ domainId: 1, docType: 1, docId: 1 }, u);
|
||||
await ic({ domainId: 1, docType: 1, owner: 1, docId: -1 });
|
||||
// For problem
|
||||
await ic({ domainId: 1, docType: 1, title: 'text' }, s);
|
||||
await ic({ domainId: 1, docType: 1, search: 'text', title: 'text' }, s);
|
||||
await ic({ domainId: 1, docType: 1, category: 1, docId: 1 }, s);
|
||||
await ic({ domainId: 1, docType: 1, hidden: 1, category: 1, docId: 1 }, s);
|
||||
await ic({ domainId: 1, docType: 1, tag: 1, docId: 1 }, s);
|
||||
|
||||
Reference in new issue
Block a user