Similar thoughts: I used unit tests to explore that issue with SolrJ,
originally encoding with ClientUtils; The returned results had "|"
many places in the text, with no clear way to un-encode. I eventually
ran some tests with no encoding at all, including strings like
"<tag>hello & goodbye</tag>"; such strings were served and fetched
without errors. In queries at the admin console, they show up in the
JSON results correctly.  What's left? I share the confusion about what
is really going on.

Jack

On Thu, Jan 17, 2013 at 2:44 AM, Bruno Dusausoy <bdusau...@yp5.be> wrote:
> Hi,
>
> I have some problems related to URL encoding.
> I'm using Solr 3.6.1 on a Windows (32 bit) system.
> Apache Tomcat is version 6.0.36.
> I'm accessing Solr through solrj-3.3.0.
>
> When using the Solr admin and specifying my request, the URL looks like this
> (${SOLR} is there for the sake of brevity) :
> ${SOLR}/select?q=rapporteur_name%3A%28John+%2BSmith+%2B%5C%28FOO%5C%29%29
>
> But when my app launching the query, the URL looks like this :
> ${SOLR}/select?q=rapporteur_name%3A%28John%5C+Smith%5C+%5C%28FOO%5C%29%29
>
> My "decoded" query, as entered in the admin interface, is :
> rapporteur_name:(John +Smith +\(FOO\))
>
> Both request return results, but only the one returns the correct ones.
>
> The code that escapes the query is :
>
> SolrQuery query = new SolrQuery();
> query.setQuery("rapporteur_name:(" + ClientUtils.escapeQueryChars("John
> Smith (FOO)") + ")");
>
> I don't know if it's the right way to encode the query.
>
> Any ideas or directions ?
>
> Regards.
> --
> Bruno Dusausoy
> Software Engineer
> YP5 Software
> --
> Pensez environnement : limitez l'impression de ce mail.
> Please don't print this e-mail unless you really need to.

Reply via email to