--- On Wed, 12/22/10, satya swaroop <satya.yada...@gmail.com> wrote:

> From: satya swaroop <satya.yada...@gmail.com>
> Subject: Different Results..
> To: solr-user@lucene.apache.org
> Date: Wednesday, December 22, 2010, 10:44 AM
> Hi All,
>          i am getting
> different results when i used with some escape keys..
> for example:::
> 1) when i use this request
>             http://localhost:8080/solr/select?q=erlang!ericson
>            
>    the result obtained is
>            
>    <result name="response" numFound="1934"
> start="0">
> 
> 2) when the request is
>              http://localhost:8080/solr/select?q=erlang/ericson
>                
>     the result is
>                
>           <result
> name="response" numFound="1" start="0">
> 
> 
> My query here is, do solr consider both the queries
> differently and what do
> it consider for !,/ and all other escape characters.
> 

First of all ! has a special meaning. it means NOT. It is part of the query 
syntax. It is equivalent to minus - operator. 

q=erlang!ericson is parsed into : 
defaultSearchField:erlang -defaultSearchField:ericson

You can see this by appending &debugQuery=on to your search URL.

So you need to escape ! in your case. 
q=erlang\!ericson will return same result set as q=erlang/ericson

You can see the complete list of special charter list.
http://lucene.apache.org/java/2_9_1/queryparsersyntax.html#Escaping Special 
Characters






Reply via email to