5

I have long been using the answers:1 filter to limit search results to questions with answers, but it seems that it does not always work as described.

For example, this SO search returns 18 hits, with the topmost 3 having 4, 2, and 1 answers respectively, but those answers are not indicated on the search results:

Screen capture

And sure enough, when I add answers:1 (this search), those questions are not included in the results.

Is it a bug?
How do I search for questions that have answers without excluding those?

Edit:

Thanks to Shadow The Spring Wizard's answer, I understand that the first query finds both questions and answers containing the search terms, while the second finds only questions.

So the question remains: what is the syntax to search for both answers and questions with answers? I tried AllowShortEnumsOnASingleLine (answers:1 or is:question) but it did not work.

2
  • I'm not sure you can actually search for both answered questions and answers. answer:n and isanswered:yes return only questions, and is:answer returns only answers. Trying to combine them leads to the post type of the second condition to be ignored, so ` isanswered:yes is:answer` or ` answers:1 is:answer` return only questions. This actually is a bug in the interface, which for the second query says "Search options answers only not deleted answers>= 1" which is not true because it is not "answers only", it is "questions only". Probably this is already reported somewhere, I'll check.
    – Marijn
    Commented Jun 3, 2023 at 13:14
  • Hm actually I can't find anything, meta.stackoverflow.com/questions/423090/… is the closest, not really the same issue, but maybe the same underlying implementation limitation.
    – Marijn
    Commented Jun 3, 2023 at 13:29

1 Answer 1

7

Not a bug.

The answers:X operator is used to find questions, if X is 0 it will return questions with no answers, if X is more than 0 it will return questions having X or more answers. But it will return only questions.

You can use is:a to get back only answers.

For more details: https://stackoverflow.com/help/searching

4
  • 1
    The problem is that it does not return some questions. Like this one: stackoverflow.com/q/23072223/181238. Oh I see, the search string is not in the question.
    – Alex O
    Commented Jun 3, 2023 at 2:06
  • @AlexO so all is clear and good now? :-) Commented Jun 3, 2023 at 6:01
  • Almost, see edit.
    – Alex O
    Commented Jun 3, 2023 at 11:52
  • @AlexO sadly, pretty sure there isn't such a way, at least with the ordinary search. Might look into the custom filters or Filtered Questions on se.com but it might get complex. (And of course, last resort is SEDE.) Commented Jun 4, 2023 at 5:26

You must log in to answer this question.

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