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 shbn <sh...@ewave.co.il> on 2009/07/03 23:11:54 UTC

search for percent char with lucene

Hi,
I am trying to find results with percent chars without any success.

for exemple the word " bla bla 1%"
when i type 'bla bla' i got results, but if i try to type '%' i got 0
results.

does any one have any idea..

thanks
-- 
View this message in context: http://www.nabble.com/search-for-percent-char--with-lucene-tp24328868p24328868.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Re: search for percent char with lucene

Posted by shbn <sh...@ewave.co.il>.
HI,
i used the StandartAnalyzer. i changed to WhitespaceAnalyzer so now i got
results when i search for '1%' for exemple, but if i type only the '%' i
still got results.

/***
doc = new Document();
nameField = new
Field("name",strN,Field.Store.YES,Field.Index.TOKENIZED,Field.TermVector.WITH_POSITIONS);
 doc.add(nameField);
writer.addDocument(doc);

/****





Erick Erickson wrote:
> 
> You have to tell us what analyzers you are using. Many analyzers
> will throw out non alpha-num characters.
> 
> Even better, a small, self-contained test case illustrating your problem
> would help us help you.
> 
> Best
> Erick
> 
> On Fri, Jul 3, 2009 at 5:11 PM, shbn <sh...@ewave.co.il>
> wrote:
> 
>>
>> Hi,
>> I am trying to find results with percent chars without any success.
>>
>> for exemple the word " bla bla 1%"
>> when i type 'bla bla' i got results, but if i try to type '%' i got 0
>> results.
>>
>> does any one have any idea..
>>
>> thanks
>> --
>> View this message in context:
>> http://www.nabble.com/search-for-percent-char--with-lucene-tp24328868p24328868.html
>> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/search-for-percent-char--with-lucene-tp24328868p24332318.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Re: search for percent char with lucene

Posted by Erick Erickson <er...@gmail.com>.
You have to tell us what analyzers you are using. Many analyzers
will throw out non alpha-num characters.

Even better, a small, self-contained test case illustrating your problem
would help us help you.

Best
Erick

On Fri, Jul 3, 2009 at 5:11 PM, shbn <sh...@ewave.co.il> wrote:

>
> Hi,
> I am trying to find results with percent chars without any success.
>
> for exemple the word " bla bla 1%"
> when i type 'bla bla' i got results, but if i try to type '%' i got 0
> results.
>
> does any one have any idea..
>
> thanks
> --
> View this message in context:
> http://www.nabble.com/search-for-percent-char--with-lucene-tp24328868p24328868.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>