7

It appears that if smart quotes (“”) are used in the title of a question, then searching for the quoted text that includes a colon in quotes in a search doesn't show the question. Noting that the title of this question contains “test: text” and “xtest xtext”, compare these two searches:

and these two searches:

Yet searching for just one of the words with and without quotes has these results:

Now, for the really nasty part, both smart and dumb quotes in titles are rendered as smart quotes. For instance, in the title text of this question dumb quotes is in dumb quotes. However, when copying this text from the title, the rendered smart quotes are copied as smart quotes. This means that if you highlight and copy “dumb quotes” from the title and search for it, you get zero results:

If you copy text from a title and paste it into the search box and surround it by quotes, the question from which you copied the text might not be included in the search results!

It's dangerous to speculate about bugs in code that you can't see, but I wonder whether smart quotes are treated as delimiters or letters in title text (e.g., does the title of this question contain the word test or “test, and when the keyword handling in the search interface takes place.

How I came across this

I ran into this while adjusting some titles to include verbatim error messages so that future users have a better chance of finding them (and to help with comments like "searching for this error message on Stack Overflow already brings up [lots of results]."). I tend to use smart quotes while I'm typing, and have just realized that this may be self-defeating in this case. The particular case that got me to this was a Scheme error, "application: not a procedure":

These won't work for much longer. Whether the search functionality should be more robust or not, I need to be able to find these questions, so I'm going to remove the smart quotes from their titles.

  • 1
    Really? I get one result - this question, for both of those searches. – Doorknob Oct 21 '13 at 13:16
  • @Doorknob OK, maybe it involves a colon; I've updated the example. Can you check with the new example, and reply back? (And if you get the results I'm seeing, maybe delete your comment? I should have checked the example more carefully before posting, but I think it's working now, but the first comment people see now is "not reproducible". But thanks for checking the first one so quickly. :) ) – Joshua Taylor Oct 21 '13 at 13:24
  • This one is buggy ! (Really weird) I guess you might be right with the column... You should re-add your example that was working before without the column though so people can see that one works and the other one does not – Hugo Dozois Oct 21 '13 at 14:16
  • @HugoDozois Yes, I failed at reproducing this in the first version of my question, but I've updated now to include a working reproduction on both Meta (using this question) and Main (the one I originally came across). So now I know it's not SO specific, at least. – Joshua Taylor Oct 21 '13 at 14:19
  • @HugoDozois Good point about including the non-colon case; I'll put (a version of it) back in. – Joshua Taylor Oct 21 '13 at 14:22
  • 2
    Wow I really can't write colon correctly >_< – Hugo Dozois Oct 21 '13 at 14:25
  • @HugoDozois Gah, this is frustrating. I just updated the title to include some quoted text without a colon, and I get the same problem. But Doorknob's original comment is right; the initial example I had didn't work. Time to dig it up again. – Joshua Taylor Oct 21 '13 at 14:26
  • @HugoDozois And now, with text in smart quotes in smart quotes again, searching for it with smart quotes brings it up, and searching for it without doesn't. Perhaps it's not significant whether certain characters are included in the quoted text, but whether they're in the title at all. – Joshua Taylor Oct 21 '13 at 14:29
4

I'm pretty sure that the cause of this is that smart quotes are treated as letters. For example, if you were using as instead of quotes, it would be something like

aError, something bad happeneda

And searching for

"Error, something bad happened"

Would not find it. A solution would just be to ignore smart quotes entirely, although that might not be the best idea.

  • If this is what's happening, then it's particularly nasty, because dumb quotes in the title are rendered as smart quotes, which means that you can copy text from the title, paste it into search, surround it with quotes, and have the results not include the question from which you copied the text. (I've updated the question to show an example of this.) – Joshua Taylor Oct 21 '13 at 15:21
  • I've just updated my question (again): searching for one of the words that has a smart quote (but without any quoting) does find the word. That is, searching for happened in your example would find a result, but "happened" wouldn't. I'm not sure whether I'd expect a search for happened to turn up a result with happeneda. – Joshua Taylor Oct 21 '13 at 15:28
  • 1
    @Joshua Hmm, this is getting weirder and weirder... – Doorknob Oct 21 '13 at 18:09

You must log in to answer this question.

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