Suggested Topics - Title & Content based Suggestions

The tricky performance piece is the RPC mechanism here. You don’t want to launch a brand new Python process for every single topic view.

Even an HTTP call may be too slow.

Perhaps … populate a related_topics (topic_id, related_topic_id, rank) table? You could then lean on WebHooks to get the table updated quickly when people post new topics and Ruby does not need to call Python.

On the Discourse side implementation would be pretty easy, you would simply rewrite this method to look up the information in your new related_topics table.

2 Likes