I tried to find some of my old answers on Stack Overflow but did not get the results I expected. The problem seems to apply all SE sites. I tested dba.SE and Super User, and they exhibit the same problem.

The "Advanced Search Tips" advertise:

exact "words here"

There is isn't any mention this would exclude code. Nothing is mentioned in the help page, either.

This related post explicitly claims it should work for code or symbols:

Quoted phrases are exact matches except for case-sensitivity, for example, you can search for code or symbols.

But that does not seem to work as advertised.

user:939860 "WITH RECURSIVE" returns four results (the phrase appears outside code blocks).

user:939860 WITH RECURSIVE (no double quotes) returns 108 results - obviously ignoring the noise word "with". Most of the results have the exact phrase WITH RECURSIVE - inside code blocks.

This does the job, mostly:

user:939860 code:"WITH RECURSIVE"


  • The keyword code: seems to be a secret, neither mentioned in the "Advanced Search Tips" nor on the help page.

  • Now I get only code results. The attempt to use OR does not work: user:939860 code:"WITH RECURSIVE" OR "WITH RECURSIVE"

  • The more useful default would be to search in all text including code to begin with. It is counter-intuitive that code is excluded. After all, that seems to be the behavior with plain words (not phrases). Example: user:939860 RECURSIVE. That includes code and non-code by default.

Is phrase search broken in this respect or am I missing something?


You must log in to answer this question.

Browse other questions tagged .