From 32e37058a9dad1f5e367421a3c9e63505fd622a0 Mon Sep 17 00:00:00 2001 From: skakac Date: Mon, 4 Nov 2024 15:34:07 +0100 Subject: [PATCH] Fix index for better search --- src/models/token.model.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/models/token.model.ts b/src/models/token.model.ts index 678135c..21666a5 100644 --- a/src/models/token.model.ts +++ b/src/models/token.model.ts @@ -73,8 +73,7 @@ export const TokenSchema = new mongoose.Schema( ) TokenSchema.index({ address: 1, chainId: 1 }, { unique: true }) -TokenSchema.index({ name: 1 }, { collation: { locale: 'en', strength: 1 } }) -TokenSchema.index({ symbol: 1 }, { collation: { locale: 'en', strength: 1 } }) +TokenSchema.index({ name: 'text', symbol: 'text' }) TokenSchema.index({ chainId: 1 }) TokenSchema.index({ holders: -1 }) TokenSchema.index({ verified: -1 })