lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
Subject Re: unable to search from a string containing numbers seperated by comma.
Date Thu, 30 Aug 2007 20:24:09 GMT
Give these tips a try to see if they help:
http://wiki.apache.org/lucene-java/ 
LuceneFAQ#head-3558e5121806fb4fce80fc022d889484a9248b71

Luke is your friend.

Cheers,
Grant

On Aug 30, 2007, at 6:06 AM, prabin meitei wrote:

> Hi,
>   I am trying to search from an idlist (string containing comma  
> seperated
> numeric values)
>
> eg:
> QueryParser vParser = new QueryParser("idlist", new AlphanumAnalyzer 
> ()); //
> analyzer using custom lettertokenizer which tokenize nuber also.  
> class is
> given below.
> Query q = vParser.parse("55"); // example
>
> now even if the field idlist contains say (44, 55, 66)
> my search returns 0 hit. is there any alternative solution or is  
> there some
> problem with wat i am using.
>
> Thanks in advance.
>
> public class AlphanumericTokenizer extends LetterTokenizer {
>   public AlphanumericTokenizer(Reader reader) {
>     super(reader);
>   }
>
>   protected boolean isTokenChar(char c) {
>     return super.isTokenChar(c) || Character.isDigit(c);
>   }
> }

--------------------------
Grant Ingersoll
http://lucene.grantingersoll.com

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ



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


Mime
View raw message