Mailing List Archive

solr can't escape special characters
Hi, all:
I met a problem with solr. I have docs containing characters like []?! etc. I want to search such docs. Documents say


Escaping Special Characters

Lucene supports escaping special characters that are part of the query syntax.

The current list special characters are

&& || ! ( ) { } [ ] ^ " ~ * ? : \ To escape these character use the \ before the character. For example to search >for (1+1):2 use the query:

(1+1)\:2



But on solr Ui Admin, It doesn¡¯t work as documents say. Result show below
[cid:image001.jpg@01D21279.61E29DF0]
Where is the problem? Thank you for your help!

Best Wishes!

Zhang Yue
Re: solr can't escape special characters [ In reply to ]
Hi,

Can you post your question over at solr-user@lucene.apache.org mailing list?
And FYI the image attachement did not make it thgough. Can you upload it somewhere (Dropbox?) and include the link?
Can you also try your query directly in the browser address bar, not in the Admin UI? e.g. http://localhost:8983/solr/techproducts/select?q=test

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com

> 19. sep. 2016 kl. 07.24 skrev Yue9 Zhang 张越 <zhangyue9@xiaomi.com>:
>
> Hi, all:
> I met a problem with solr. I have docs containing characters like []?! etc. I want to search such docs. Documents say
>
> Escaping Special Characters
>
> Lucene supports escaping special characters that are part of the query syntax.
>
> The current list special characters are
>
> && || ! ( ) { } [ ] ^ " ~ * ? : \ To escape these character use the \ before the character. For example to search >for (1+1):2 use the query:
>
> (1+1)\:2
>
>
> But on solr Ui Admin, It doesn’t work as documents say. Result show below
>
> Where is the problem? Thank you for your help!
>
> Best Wishes!
>
> Zhang Yue
Re: solr can't escape special characters [ In reply to ]
Which field tranformer you are using in your schema
On Sep 19, 2016 9:50 PM, "Yue9 Zhang 张越" <zhangyue9@xiaomi.com> wrote:

> Hi, all:
>
> I met a problem with solr. I have docs containing characters like
> []?! etc. I want to search such docs. Documents say
>
>
>
> Escaping Special Characters
>
> Lucene supports escaping special characters that are part of the query
> syntax.
>
> The current list special characters are
>
> && || ! ( ) { } [ ] ^ " ~ * ? : \ To escape these character use the \
> before the character. For example to search >for (1+1):2 use the query:
>
> (1+1)\:2
>
>
>
>
>
> But on solr Ui Admin, It doesn’t work as documents say. Result show
> below
>
>
>
> Where is the problem? Thank you for your help!
>
>
>
> Best Wishes!
>
>
>
> Zhang Yue
>
>
>