Why are the search result counts different for the different tabs?
What is meta?
- Any Stack Exchange user can ask a question
- The community provides support, votes on ideas, and reports bugs
- Your voice helps shape the way Stack Exchange operates
This is a bit of a side-effect of how we do things in presentation. When it comes to searching for terms that may appear in multiple answers in the same question, we "roll up" to the question for presentation (in most cases). To keep things sane, we're only querying about 5,000 posts from our search index before this rollup occurs.
Now there's 2 factors in play here, a "roll-up" has to be occurring (this isn't always the case, for example a
This means your most likely candidates for seeing this are questions with lots of answers and a very broad topic returning many matches overall as well.
Now why does this happen per tab? Well it's how the answers are being sorted. For example sorting by votes may find a big, possibly older, question with a lot of answers that have high votes. Every answer on that question would roll-up to that question producing a single search result rather than
We can't realistically (from a performance perspective) prevent this from happening in most cases, but it can and has been improved for the next build. I added a search result buffer zone for the roll-up scenarios that'll fetch some (many) more results before trimming them down to the 5,000 (this is set per-site, but 5,000 everywhere at the moment). If your search hits a lot of questions with a ton of matching answers each...well, you'll see different numbers. For most cases though, this buffer will fix the issue, and you'll see "5,000+" as the count on the right.