lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "prabin meitei" <prabin.mei...@gmail.com>
Subject unable to search from a string containing numbers seperated by comma.
Date Thu, 30 Aug 2007 10:06:33 GMT
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);
  }
}

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message