Skip to content

Instantly share code, notes, and snippets.

@traut
Created November 10, 2010 23:00
Show Gist options
  • Save traut/671692 to your computer and use it in GitHub Desktop.
Save traut/671692 to your computer and use it in GitHub Desktop.
it's escaping Solr query characters.
Example:
var s = solr.escape('it's 11:00 -- do you know where your children are?")
var query = "+title:" + s;
and this works fine:
> A search for "+description:it's 11\:00 \-\- do you know where your children" returned 0 documents.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment