I have a MongoDB database in which there will be 5 to 10 inserts per day, each day. The structure of the data that will be inserted looks like this:
{
question: 'text here',
date: '01/01/2000 01:01',
title: 'Some title',
client: 'name',
assigned_to: ['name1', 'name2', 'name3'],
answers: [
{answer: 'bla bla'},
{answer: 'bla bla'},
{answer: 'bla bla'}
]
}
I need to search for a word or a serie of words in all the text fields (question, title, and all the answers). I have been searching and this is what I have found so far. There are 3 solutions:
a) $regexp
b) Enable full-text search in MongoDB and use it
c) Save the structure with the following format (and then use multi-key search)
{
question: 'text here',
question_s: ['text', 'here'],
date: '01/01/2000 01:01',
title: 'Some title',
title_s: ['Some', 'title'],
client: 'name',
assigned_to: ['name1', 'name2', 'name3'],
answers: [
{answer: 'bla bla', answer_s: ['bla', 'bla']},
{answer: 'bla bla', answer_s: ['bla', 'bla']},
{answer: 'bla bla', answer_s: ['bla', 'bla']}
]
}
Knowing the exact format of my data and how big it will be (estimated for the next 10 years), which one of those 3 is better in terms of speed and usability? (considering also the time/brain pain each one of those solutions requieres, as setup, configuration, etc)