You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2011/10/23 15:13:29 UTC

[Solr Wiki] Update of "SolrQuerySyntax" by JaapBoerma

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "SolrQuerySyntax" page has been changed by JaapBoerma:
http://wiki.apache.org/solr/SolrQuerySyntax?action=diff&rev1=27&rev2=28

Comment:
Added special characters that need escaping in queries

  See also SolrPlugins for information on writing your own query parser.
  
  <<Anchor(urlescaping)>>
+ 
+ = Special Characters in SOLR =
+ 
+ The following characters are used by the [[http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Escaping%20Special%20Characters|query syntax]] and should be escaped to use any of these:
+ 
+ {{{ 
+ + - && || ! ( ) { } [ ] ^ " ~ * ? : \
+ }}}
+ 
+ To escape these characters, use a single \ before the character. For example, to search for (1+1):2 use the query:
+ 
+ {{{
+ \(1\+1\)\:2
+ }}}
+ 
  = NOTE: URL Escaping Special Characters =
  
  Please note that many characters in the Solr Query Syntax (most notable the plus sign: "`+`") are special characters in URLs, so when constructing request URLs manually, you must properly URL-Encode these characters.