Backslash in JSON just tells JSON to escape the next character, while what
you really want is to pass a backslash through to the Solr query parser,
which you can do with a double backslash.

Alternatively, you could use quotes around the string in Solr, which would
require you to escape the quotes in JSON, with a single backslash.

-- Jack Krupansky

On Mon, Mar 7, 2016 at 5:49 PM, Iana Bondarska <yana2...@gmail.com> wrote:

> Hi All,
> could you please tell me if escaping special characters in search keywords
> works in json api.
> e.g. I have document
>  {
> "string_s":"new value"
> }
> And I want to query "string_s" field with keyword "new value".
> In path params api I can escape spaces in keyword as well as other special
> characters with \ .
> following query finds document:
> http://localhsot:8983/solr/dynamic_fields_qa/select?q=string_s:new\
> value&wt=json&indent=true
> But if I try to run same search using json api, nothing is found:
>
> http://localhsot:8983/solr/dynamic_fields_qa/select?q=*:*&json=
> {"query":"string_s:new\ value"}
>
> Best Regards,
> Iana Bondarska
>

Reply via email to