Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Match:

type

name

description

MatchTypeString

type

MatchType is an enumeration of: { thread, reply }

String

matchedId

If the type is a tread, then the matched ID will be a thread ID. If the type is reply the matched ID will be a reply IDthreadId

The ID of the matching thread. If this is a match to the text of the thread, the replyId will be null.

String

replyId

If this is a match to a reply within a thread, the replyId will have a non-null value.

Implementation

Currently, the maximum number of threads for a single discussion forum is 667, while the average is 10.1. Similarity, the maximum number of replies to a single discussion thread is 90, while the average is 3.1. Since these are fairly small numbers and we do not require advanced search features like faceted navigation, we recommend an implementation based on the MySQL Full-Text search feature. This is by far the most economic option since we can leverage the feature in our existing database without incurring any additional costs.

...

Code Block
languagesql
CREATE TABLE IF NOT EXISTS `DISCUSSION_SEARCH_INDEX` (
  `ID``FORUM_ID` BIGINT NOT NULL,
  `THREAD_ID` BIGINT `TYPE` ENUM('thread', 'reply')NOT NULL,
  `REPLY_ID` BIGINT,
  `TEXT` TEXT NOT NULL,
  PRIMARY KEY (`ID``FORUM_ID`, `TYPE``THREAD_ID`,`REPLY_ID`),
  FULLTEXT idx (`TEXT`)
);

...