diff --git a/src/api/controller.ts b/src/api/controller.ts index a9d7b82..cb50f84 100644 --- a/src/api/controller.ts +++ b/src/api/controller.ts @@ -72,15 +72,8 @@ export async function searchByContent( ...(data.chainId ? { chainId: data.chainId } : {}), $or: [ { - name: { - $regex: escapeRegex(data.query), - $options: 'i', - }, - }, - { - symbol: { - $regex: escapeRegex(data.query), - $options: 'i', + $text: { + $search: data.query, }, }, { @@ -101,5 +94,5 @@ export async function searchByContent( } function escapeRegex(string: string) { - return string.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&'); -} \ No newline at end of file + return string.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&') +}