This might be something that only Stack Exchange personnel can answer, but...

When using advanced search terms, if I were looking for all of my questions that have an accepted answer

user:me is:question hasaccepted:yes

would appear to give the exact same results as

user:me hasaccepted:yes

since, of course, only questions can have an accepted answer.

From a results standpoint, the is:question is redundant. But what about on the query back-end? Does hasaccepted:* already include the same query filter as is:question? Or does adding is:question make for a more efficient query by eliminating more records right away? Or does it make no never mind?

In a related vein, is there any reason why hasaccepted:yes would ever give different results than is:question hasaccepted:yes?

  • I believe so, in the same way that isaccepted:yes implies being an answer. – Brad Larson Feb 17 '14 at 15:48
  • 2
    I've always assumed this to be the case (that is:question is implied by the hasaccepted) but it would be interesting to understand if there is any benefit to adding is:question to the query. – psubsee2003 Feb 17 '14 at 15:54
  • 1
    As a footnote: trying hasaccepted:yes is:answer results in in parameter being overridden: the query returns questions. – How About a Nice Big Cup of Feb 17 '14 at 17:26

Yes, hasaccepted does imply is:question.

We check for it and patch on an is:question - so:

user:me hasaccepted:yes

Ends up being equivalent to:

user:me is:question hasaccepted:yes

This is true to other search operators that imply a question (such as the number of answers range selector - answers:), and of course isaccepted implies is:answer.

  • so, there's no combination of operators that means "return all answers that I wrote on questions without an accepted answer"? – KutuluMike Dec 18 '16 at 18:08

You must log in to answer this question.

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