More querying issues from me!
When doing a text search with a collection with a lot of entries it generates a query like the following:
Mongoose: posts.countDocuments({ '$and': [ { '$or': [ { text: { '$regex': /(?=.*(?:(?:[^\p{L}\p{N}])|^).*Sed.*(?=[^\p{L}\p{N}]|$)).+/i } } ] } ]}, {})
Mongoose: posts.find({ '$and': [ { '$or': [ { text: { '$regex': /(?=.*(?:(?:[^\p{L}\p{N}])|^).*Sed.*(?=[^\p{L}\p{N}]|$)).+/i } } ] } ]}, { limit: 10, sort: { createdAt: -1 }, skip: 0, projection: {} })
This regex seems to take a while to process with a large amount of data (reprod example
https://github.com/payloadcms/payload/compare/master...rymate1234:payload:bug/filtering)
Will it ever be possible to customise how this text search works?
Is this because of the emojis?
I don't believe so
but I know my dataset has emojis in so I added them
This was fixed in
https://github.com/payloadcms/payload/issues/2832Star
Discord
online
Get help straight from the Payload team with an Enterprise License.