If matching words are in quotes, the result is not shown:


The search engine is only considering whitespace delimited text when searching for exact results.

In other words, searching for exact matches requires you to include punctuation. In your first example, there is no literal what have you tried sentence without punctuation in the question text. There are only forms with quotes around them:

"What have you tried?"
"What have you tried"

I have not been able to figure out how to search for an exact phrase with quotes; there seems to be no way to escape literal quotes available.

But you can search for another phrase that includes punctuation:

This is generally a good thing,

Search for "This is generally a good thing" is:q fails, but if you add the comma and search for "This is generally a good thing," is:q then suddenly there is a match.

I am not that familiar with elasticsearch / Lucene configuration, but if it is possible to configure the index to not include punctuation when searching for exact phrases (while at the same time allowing you to match exact punctuation too), then this is a bug in how the search engine on Stack Exchange is configured.

  • I wonder - if Lucene exact search would skip punctuation, would it also throw searching for programming related concepts out too? How'd you search C++, .NET or for (i=0; i<len; i++) then?
    – eis
    Dec 16 '14 at 8:33
  • @eis: Which is why I qualified it as while at the same time allowing you to match exact punctuation too. Dec 16 '14 at 8:36
  • yes, I wasn't criticizing this answer - was just wondering if there is a way to have a different rules or some other workaround. Sorry, it was somewhat unclear.
    – eis
    Dec 16 '14 at 9:05

Just a heads up that a search change rolled out today which did a few useful things; one of which was making this work correctly. You should be experiencing a much smoother search - and we're not done yet!

You must log in to answer this question.

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