You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Gal Mainzer <ma...@gmail.com> on 2012/02/01 07:43:58 UTC

Re: using character '%' in queries (Lucene v3.1.0)

I tried to use escaping but it didn't work as well (and % is not in the
list).
my field analyzer is ngram (min=1 max=15) and i'm writing the query using
QueryBuilder API rather than string so it's not being parsed.

any ideas?

Thanks,
Gal

On Tue, Jan 31, 2012 at 9:36 PM, Erick Erickson <er...@gmail.com>wrote:

> Depending on your analyzer, this could well be stripped
> from the input. Perhaps try using Luke to examine the
> actual values in the index to see if it's there.
>
> And the escape character for Lucene is the backslash.. See:
> http://lucene.apache.org/java/2_9_1/queryparsersyntax.html#Escaping
> Special Characters
>
>
> Best
> Erick
>
> On Tue, Jan 31, 2012 at 12:32 PM, Gal Mainzer <ma...@gmail.com> wrote:
> > Hi,
> >
> >  I’m using lucene on Hebrew MySql tables. I used ngram (1-15 gram sizes)
> in
> > my name analyzer and the only thing that doesn’t work for me is when I
> try
> > to use ‘%’ in my parsing string (didn’t find any match).
> >
> > I tried escaping it, using double character (“%%”) but nothing worked.
> >
> >
> >
> > Thanks,
> >
> > Gal
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: using character '%' in queries (Lucene v3.1.0)

Posted by Ian Lea <ia...@gmail.com>.
And have you used Luke to see exactly what is being indexed, as Erick suggested?

See http://wiki.apache.org/lucene-java/LuceneFAQ#Why_am_I_getting_no_hits_.2BAC8_incorrect_hits.3F.
for other things to check.


--
Ian.



On Wed, Feb 1, 2012 at 6:43 AM, Gal Mainzer <ma...@gmail.com> wrote:
> I tried to use escaping but it didn't work as well (and % is not in the
> list).
> my field analyzer is ngram (min=1 max=15) and i'm writing the query using
> QueryBuilder API rather than string so it's not being parsed.
>
> any ideas?
>
> Thanks,
> Gal
>
> On Tue, Jan 31, 2012 at 9:36 PM, Erick Erickson <er...@gmail.com>wrote:
>
>> Depending on your analyzer, this could well be stripped
>> from the input. Perhaps try using Luke to examine the
>> actual values in the index to see if it's there.
>>
>> And the escape character for Lucene is the backslash.. See:
>> http://lucene.apache.org/java/2_9_1/queryparsersyntax.html#Escaping
>> Special Characters
>>
>>
>> Best
>> Erick
>>
>> On Tue, Jan 31, 2012 at 12:32 PM, Gal Mainzer <ma...@gmail.com> wrote:
>> > Hi,
>> >
>> >  I’m using lucene on Hebrew MySql tables. I used ngram (1-15 gram sizes)
>> in
>> > my name analyzer and the only thing that doesn’t work for me is when I
>> try
>> > to use ‘%’ in my parsing string (didn’t find any match).
>> >
>> > I tried escaping it, using double character (“%%”) but nothing worked.
>> >
>> >
>> >
>> > Thanks,
>> >
>> > Gal
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org