From 772aaf8c048c1a3f4bd4e9888402b14d47b72b12 Mon Sep 17 00:00:00 2001 From: bangbang93 Date: Tue, 24 Oct 2023 09:33:55 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=85=A8=E6=96=87=E6=A3=80?= =?UTF-8?q?=E7=B4=A2=E7=9A=84=E5=8A=9F=E8=83=BD=E4=BA=A4=E7=BB=99meilisear?= =?UTF-8?q?ch=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/article/article.model.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/app/article/article.model.ts b/src/app/article/article.model.ts index 7e941638..6a790756 100644 --- a/src/app/article/article.model.ts +++ b/src/app/article/article.model.ts @@ -29,8 +29,6 @@ export class ArticleWordpress { } @model('article', {timestamps: true}) -// eslint-disable-next-line camelcase -@index({content: 'text'}, {default_language: 'ngram'}) export class Article implements IArticleSchema { @id() public _id!: ObjectId @prop() public title!: string @@ -128,19 +126,6 @@ export class Article implements IArticleSchema { .skip(skip) .limit(limit) } - - @statics() - public static async search(this: IArticleModel, keyword: string, skip: number, - limit: number): Promise { - return this.find({ - $text: { - $search: keyword, - }, - }) - .sort({_id: -1}) - .skip(skip) - .limit(limit) - } } export type IArticleDocument = DocumentType