I have a very large database collection of around 540GB with 4 billion items.
The item contains various metadata but one important field "message" which is free text.
I would like to be able to query it for things like:
What is the best type of index to create, and how can I create it?
I was also wondering if anyone had example queries?
I having been reading into text indexes and wildcard text indexes but I'm not sure what is the best fit.
A text index would be a good fit here:
db.mycoll.createIndex({ message: 'text' })
db.mycoll.find({ $text: { $search: 'error' } })