solr can't escape special characters

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

solr can't escape special characters

Yue9 Zhang 张越

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

 

Reply | Threaded
Open this post in threaded view
|

Re: solr can't escape special characters

Jan Høydahl / Cominvent
Hi,

Can you post your question over at [hidden email] 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 张越 <[hidden email]>:
>
> 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

Reply | Threaded
Open this post in threaded view
|

Re: solr can't escape special characters

SIDDHAST® Roshan
In reply to this post by Yue9 Zhang 张越
Which field tranformer you are using in your schema
On Sep 19, 2016 9:50 PM, "Yue9 Zhang 张越" <[hidden email]> 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
>
>
>