I have a collection with 100k+ documents and counting. Right now the search functionality in the list view for the collection is quite slow. I have tried optimizing with indexes, but its still operating quite slowly.
For example, I have a collection called 'jobs' and i want to search it by fields 'id', 'title_raw', and 'company_raw'. My assumption is that the app is creating a query like this:
{
$or: [
{ company_raw: { $regex: 'Accounts Payable Clerk', $options: 'i' } },
{ title_raw: { $regex: 'Accounts Payable Clerk', $options: 'i' } },
{ _id: { $regex: 'Accounts Payable Clerk', $options: 'i' } }
]
}
is that correct?
This runs pretty fast in mongosh or when I run the aggregation from my own code, but i takes 30-50 seconds in the Payload List view.
My questions are:
- Am I understanding the search query properly?
- Is there any way to create custom logic for function that provides data to this view without having to rewrite the whole component? I've tried writing my own tables as an override but they were quite a pain to maintain.