RetroFed Forum
Your home away from modern life.
How exactly does lemmy search work for related posts?
Post Reply
AuthorMessage
I Cast Fist programming.dev ICastFist@programming.dev
Joined: 2023-06-22
Quote

I don't know if this is stance specific, but whenever I create a new post and start typing the title, it'll list some "posts that might be related", limited to the community if it's already selected.

The problem is that the posts are almost never related to anything I'm writing in the title or might even write in the body at all. For instance, I just posted a question on how to poison videos against AI, the "might be related" posts were about Donald Trump and Epstein, with another post being about WoW Mists of Pandaria.

It seems to look for the post body for all the words in the title first instead of looking for any similar title first

10   Original
Schwim Dandy piefed.zip schwim@piefed.zip
Joined: 2025-06-15
#2 · Quote Reply

It seems to be a non-common word comparison score, which is often mistaken.

Basically, when a post is submitted, the system creates a word list for the post, strips the common words out of it, then creates an association between the post ID and each remaining word. When a search occurs, each word of the search phrase is checked against the db holding the associations and the post with the most matching associations will be considered the most relevant.

It can be seen how this system could be incredibly incorrect when matching posts to a search phrase but it's really the one that's most often used in software, due to it's ease of implementation and low overhead, resource-wise.

9
frongt lemmy.zip frongt@lemmy.zip
Joined: 2025-07-31
#3 · Quote Reply

Lemmy is open source, you can go look. You'll probably have to look at the frontend to see how it calls the search on the backend: https://github.com/lemmynet

0
Post Reply
Back to top