Skip to content

Commit

Permalink
Merge pull request #404 from mahendraHegde/partial-search
Browse files Browse the repository at this point in the history
feat: add support for partial word search
  • Loading branch information
DonKoko authored Sep 29, 2023
2 parents 2800ae0 + d1e1ddf commit 3379c74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/modules/asset/service.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,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 = {
Expand Down

0 comments on commit 3379c74

Please sign in to comment.