Merge pull request #2855 from payloadcms/fix/#2832

fix: #2832, slow like queries with lots of records
This commit is contained in:
James Mikrut
2023-06-19 10:18:49 -04:00
committed by GitHub
3 changed files with 33 additions and 6 deletions

View File

@@ -648,6 +648,22 @@ describe('collections-rest', () => {
expect(result.totalDocs).toEqual(1);
});
it('like - cyrillic characters in multiple words', async () => {
const post1 = await createPost({ title: 'привет, это тест полезной нагрузки' });
const { status, result } = await client.find<Post>({
query: {
title: {
like: 'привет нагрузки',
},
},
});
expect(status).toEqual(200);
expect(result.docs).toEqual([post1]);
expect(result.totalDocs).toEqual(1);
});
it('like - partial word match', async () => {
const post = await createPost({ title: 'separate words should partially match' });