#Text search speeds in the cms

4 messages · Page 1 of 1 (latest)

mighty copper
#

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?
ember crown
#

Is this because of the emojis?

mighty copper
#

I don't believe so

#

but I know my dataset has emojis in so I added them