Java URL encoder has that explanation at its api docs:

*When encoding a String, the following rules apply:*

*The space character " " is converted into a plus sign "+".*

at: http://docs.oracle.com/javase/6/docs/api/java/net/URLEncoder.html

so its expected to have %20 for a space character but *+* is a valid
encoding. I've faced with a similar issue when interacting my custom search
API and Solr.

Solr wiki says that:

"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."

Example from wiki is that:

                                  q=  +popularity:[10   TO   *]
+section:0

http://localhost:8983/solr/select?q=%2Bpopularity:[10%20TO%20*]%20%2Bsection:0

However converting a space character into a plus sign is a valid encoding
of URL. Should client be responsible for such kind of things or Solr code
(i.e. calling: .replace("+", "%20"))? I can fire a Jira for it and apply a
patch.

Thanks;
Furkan KAMACI

Reply via email to