We will hold messages processed for search in a new bd table. This table will has:
- processed_content - stemmed and stripped of stopwords content. When the message changes, this filed will be updated accordingly.
- message_id the id of the message. When the message gets edited, this id will be updated to the id of the edit message. Otherwise fetching the correct full content would be difficult.
- original_message_id - the id of the original message. This is first of all to have a primary key in this table that doesn't change (since message_id will be changing). The id of the original
message was just a natural candidate for this. Secondly, since we already have this, this will be used to fetch the original message (to ex access creation time or the author)
For now we will be only keeping here processed text messages, but we might extend this to ex calendar entries in the future.