mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor: ♻️ Replace Meilisearch with Sonic
This commit is contained in:
parent
2cf1537a7e
commit
19c15f7e96
15 changed files with 338 additions and 211 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import { idValidator } from "@/api";
|
||||
import { getBestContentType, urlToContentFormat } from "@/content_types";
|
||||
import { randomString } from "@/math";
|
||||
import { addUserToMeilisearch } from "@/meilisearch";
|
||||
import { proxyUrl } from "@/response";
|
||||
import type {
|
||||
Account as ApiAccount,
|
||||
|
|
@ -31,6 +30,7 @@ import {
|
|||
type UserWithRelations,
|
||||
findManyUsers,
|
||||
} from "~/classes/functions/user";
|
||||
import { searchManager } from "~/classes/search/search-manager";
|
||||
import { db } from "~/drizzle/db";
|
||||
import {
|
||||
EmojiToUser,
|
||||
|
|
@ -294,8 +294,8 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
|||
throw new Error("Failed to save user from remote");
|
||||
}
|
||||
|
||||
// Add to Meilisearch
|
||||
await addUserToMeilisearch(finalUser);
|
||||
// Add to search index
|
||||
await searchManager.addUser(finalUser);
|
||||
|
||||
return finalUser;
|
||||
}
|
||||
|
|
@ -477,8 +477,8 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
|||
throw new Error("Failed to create user");
|
||||
}
|
||||
|
||||
// Add to Meilisearch
|
||||
await addUserToMeilisearch(finalUser);
|
||||
// Add to search index
|
||||
await searchManager.addUser(finalUser);
|
||||
|
||||
return finalUser;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue