fix: Improved phrase matching in search (#6800)

* fix: Improved phrase matching in search

* test
This commit is contained in:
Tom Moor
2024-04-13 07:01:26 -06:00
committed by GitHub
parent 8490f5d558
commit 054bddb666
3 changed files with 99 additions and 33 deletions

View File

@@ -464,6 +464,28 @@ describe("SearchHelper", () => {
);
expect(totalCount).toBe(0);
});
test("should find extact phrases", async () => {
const team = await buildTeam();
const user = await buildUser({ teamId: team.id });
const collection = await buildCollection({
teamId: team.id,
userId: user.id,
});
const document = await buildDocument({
teamId: team.id,
userId: user.id,
collectionId: collection.id,
text: "test number 1",
});
document.title = "change";
await document.save();
const { totalCount } = await SearchHelper.searchForUser(
user,
`"test number"`
);
expect(totalCount).toBe(1);
});
});
describe("#searchTitlesForUser", () => {