HomePhabricator
Diffusion Comm adb573ce6a25

[keyserver] Add search table to the db

Description

[keyserver] Add search table to the db

Summary:
issue: https://linear.app/comm/issue/ENG-3313/create-a-table-in-the-db-for-holding-processed-messages-for-search
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.

Test Plan: Run yarn dev in keyserver/ checked that the migration succeeds. Created a new db, attached it in db_config.json, run yarn dev in keyserver/, cheked that the db is created correctly.

Reviewers: kamil, bartek, ashoat

Reviewed By: ashoat

Subscribers: tomek, atul

Differential Revision: https://phab.comm.dev/D7076

Details

Provenance
InkaSokolowskaAuthored on Apr 7 2023, 6:08 AM
Reviewer
ashoat
Differential Revision
D7076: [keyserver] Add search table to the db
Parents
rCOMM9e1935167b70: [keyserver] Set innodb-ft-min-token-size and innodb-ft-enable-stopword variables
Branches
Unknown
Tags
Unknown