lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Mantle" <mentalman...@hotmail.com>
Subject Can't perform exact match...?
Date Mon, 11 Apr 2011 08:47:39 GMT
Hi, I’m having some trouble with Lucene at the moment. I have a number of unique identifiers
that I need to search through. They’re in many different forms, eg. “M”, “MO”, “:MOFB”,
“FH..L-O”, etc. All I need to do is an exact prefix search: at the moment, if I type in
‘M’, I get “M”, “MO” and “:MOFB”, and I’d like to avoid getting “:MOFB”
until the user actually types in ‘:M’.

This is with a StandardAnalyzer and a PrefixQuery. I’ve tried many different combinations
of analyzer and query. If I use a WhitespaceAnalyzer or a KeywordAnalyzer, I see that tokens
are generated in a form that I’d expect (“:MOFB” instead of “mofb”, for instance),
but I can’t search with a wildcard: searching with ‘M*’ returns nothing; ‘M’ returns
“M” alone. I’ve also tried using ANALYSED and NOT_ANALYSED indexing to no avail.

Can anyone advise me on how to remedy this? There must be something I’m missing here...

Thanks,
- Chris M.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message