fix: Improved phrase matching in search (#6800)
* fix: Improved phrase matching in search * test
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user