You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by satya swaroop <sa...@gmail.com> on 2010/12/22 09:44:17 UTC

Different Results..

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.


Regards,
satya

Re: Different Results..

Posted by Marco Martinez <mm...@paradigmatecnologico.com>.
We need more information about the the analyzers and tokenizers of the
default field of your search

Marco Martínez Bautista
http://www.paradigmatecnologico.com
Avenida de Europa, 26. Ática 5. 3ª Planta
28224 Pozuelo de Alarcón
Tel.: 91 352 59 42


2010/12/22 satya swaroop <sa...@gmail.com>

> 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.
>
>
> Regards,
> satya
>

Re: Different Results..

Posted by Ahmet Arslan <io...@yahoo.com>.
--- On Wed, 12/22/10, satya swaroop <sa...@gmail.com> wrote:

> From: satya swaroop <sa...@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