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 Marius Hanganu <mh...@tremend.ro> on 2007/07/16 16:20:22 UTC

Escaping * and ?

Hello,

Is there a way in SOLR to escape * and '?' ?

Regards,
Marius

Re: Escaping * and ?

Posted by Marius Hanganu <mh...@tremend.ro>.
Thanks!

Marius

Yonik Seeley wrote:
> On 7/16/07, Marius Hanganu <mh...@tremend.ro> wrote:
>> We're trying NOT to allow searches with *. So if the user searches for
>> "a*" - instead of returning all records starting with a, we would return
>> all records containing the "a*" string.
>
> OK, a backslash escape should work:  a\*
>
> -Yonik

Re: Escaping * and ?

Posted by Yonik Seeley <yo...@apache.org>.
On 7/16/07, Marius Hanganu <mh...@tremend.ro> wrote:
> We're trying NOT to allow searches with *. So if the user searches for
> "a*" - instead of returning all records starting with a, we would return
> all records containing the "a*" string.

OK, a backslash escape should work:  a\*

-Yonik

Re: Escaping * and ?

Posted by Marius Hanganu <mh...@tremend.ro>.
Wow, that was fast :-)

We're executing URL based queries and URL escaping is not the problem.

We're trying NOT to allow searches with *. So if the user searches for 
"a*" - instead of returning all records starting with a, we would return 
all records containing the "a*" string.

Regards,
Marius

Yonik Seeley wrote:
> On 7/16/07, Marius Hanganu <mh...@tremend.ro> wrote:
>> Is there a way in SOLR to escape * and '?' ?
>
> There is URL escaping, and there is query parser escaping.
> URL encoding is standard (percent encoding), and parser escaping is
> the same as Lucene (use a backslash).
>
> It would be easier to help if you could be a little more explicit
> about exactly what you are trying to do, how you are sending the query
> to Solr (the admin web page?), and if you are seeing results that are
> unexpected.
>
> -Yonik

Re: Escaping * and ?

Posted by Yonik Seeley <yo...@apache.org>.
On 7/16/07, Marius Hanganu <mh...@tremend.ro> wrote:
> Is there a way in SOLR to escape * and '?' ?

There is URL escaping, and there is query parser escaping.
URL encoding is standard (percent encoding), and parser escaping is
the same as Lucene (use a backslash).

It would be easier to help if you could be a little more explicit
about exactly what you are trying to do, how you are sending the query
to Solr (the admin web page?), and if you are seeing results that are
unexpected.

-Yonik