OrchardCMS/OrchardDoc — pull request #133 by rtpHarry (2014-11-14 23:30:41+00:00)
Title: closes #125 - search error when using : prefix

I accidentally stumbled across this the other day and now i've figured out how to set the OrchardDocs site up on my computer I thought I'd take a look at it.

It seems starting a search with a colon triggering an advance query parser but its not a valid one. Would have expected it to just fail silently but it doesnt. Instead you see this error:

Encountered " ":" ": "" at line 1, column 0.
Was expecting one of:
...
"+" ...
"-" ...
"(" ...
"*" ...
...
...
...
...
"[" ...
"{" ...
...

I did some searches and the standard approach is:

1. Attempt an advanced query
2. Catch the exception
3. Pass it through a query sanitizer and try again

I've used the [code in this answer](http://stackoverflow.com/a/855189/156388) and it now accepts both the "broken" query in the issue and a normal text query.