3

Searching with these terms on SO:

user:939860 type unknown

This answer of mine is not found (user:939860 being me):

I have a delete-insert CTE that fails in a strange manner

But it clearly has both words in it.

I tried variations including tags, leaving away the user or is:answer etc., no dice.

It seems to be because unknown is formatted as code in the answer as has been pointed out in a comment by @Shadow Wizard. Hence, this search finds the post as desired.

Such words may or may not be formatted "correctly" across the site. Identifiers and such are mostly for better readability and that does not seem to be handled consistently across the site. It's also very hard to establish the bounds where to format as code and where not.

This makes searching a pain. Can we include minor code snippets for general search terms? Or is there a better solution?

1

At least in this case, it's difficult to append anything than some special characters to the word "unknown" to form a new word. Therefore, you can enclose "unknown" in the asterisks and be sure to safely find any words like `unknown` or 'unknown':

user:939860 type *unknown*

However, this doesn't happen always and if you would search for known in this way and enclosed it in the asterisks, you would get "unknown" in the results too.

  • Not a complete solution but certainly helpful. I wonder why there is no pointer in "Advanced Search Tips" right next to the search field. And there is also nothing on the help page indicating that wildcard cards would help to include code and non-code in the search. It just says: Use wildcard searches to broaden results; add an asterisk (*) anywhere in the word, like encour* or Ex*nge. Actually, there is nothing to indicate the special role for code in the search at all. – Erwin Brandstetter Jul 6 '15 at 14:08

You must log in to answer this question.

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