56

For almost every question there's a list of "related" questions on the right.

How are those questions selected? Is it based solely on tags? Can I do anything if I see a question on the list that is really not related to prevent it from being incorrectly listed?

1

4 Answers 4

32
+50

Things have changed a bit since 2009 :-) We rely heavily on Elasticsearch these days. The "related" questions now come from an Elasticsearch "More Like This" query.

Elastic uses tf-idf for most things, which is a standard search algorithm. Their particular implementation is documented here.

There are also some details in this blog post of 2010.

2
  • 24
    Too bad the results aren't very impressive.
    – tripleee
    Commented Nov 27, 2018 at 7:10
  • 3
    I was just going to ask a new question about "Why are the Related Questions hardly ever related to the C or C++ or shell question asked?" It truly is the exception, not the rule, when a "Related Question" is actually related to the question at hand. Can we get better AI for this? For the past 7+ years I've found the "Related Question" list basically worthless. Commented Feb 6, 2022 at 8:32
21

Jeff and Joel discussed this on Episode #32 of the Stack Overflow podcast.

Essentially, it's a vocabulary search - which other posts have the same vocabulary as this one.

Of course, there's a lot of tuning involved - the top 10k most common English words are excluded, and tags are included, plus (probably) some magic sauce they haven't revealed.

As far as I've heard, there's nothing you can do if a a question on the list is really unrelated, as the matching is entirely automated, done in real time (no preprocessing, means nothing to tweak).

6

You could listen to Podcast #32 and also be interested in Stack Overflow Search - Now 51% Less Crappy article.

0
3

They described their process in a recent podcast. If I remember correctly, they use three things: The title, the question body, and the tags. For the question body and the title, they strip out about 10,000 stop words to get the topic. I don't think there is anything you can do to choose what related posts show up other than editing the tags, title, or question.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .