From 80e6655c300622626be7e8121543383ab2489db2 Mon Sep 17 00:00:00 2001 From: Mahendra Date: Thu, 28 Sep 2023 17:16:43 -0300 Subject: [PATCH] feat: add support for partial word search --- app/modules/asset/service.server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/modules/asset/service.server.ts b/app/modules/asset/service.server.ts index 972714a23..002076e8f 100644 --- a/app/modules/asset/service.server.ts +++ b/app/modules/asset/service.server.ts @@ -108,8 +108,8 @@ export async function getAssets({ /** If the search string exists, add it to the where object */ if (search) { const words = search - .split(" ") - .map((w) => w.replace(/[^a-zA-Z0-9\-_]/g, "")) + .split(" ") + .map((w) => w.replace(/[^a-zA-Z0-9\-_]/g, "") + ":*") .filter(Boolean) //remove uncommon special character .join(" & "); where.searchVector = {