lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Searching any part of a string
Date Sat, 28 Jun 2008 00:31:55 GMT

: Thanks for the suggestions. I've used indexed n-grams before to implement
: spell-checking; I think in this case I may take a look at WildcardTermEnum
: and RegexTermEnum. It seems like a good solution because I am doing my own
: results ordering so Lucene's scoring is irrelevant in this case. I wasn't
: aware of these classes so thanks for mentioning them!

using the Enum's directly will help you avoid potential "TooManyClauses" 
exceptions that you would get with a straight WildcardQuery, but it should 
be more efficient to index ngrams and then do a Prefix style search 
because then you can skipTo(yourTerm) and iterate from there.

with WildcardTermEnum if you have a leading wildcard the TermEnum has to 
"next()" over every term inthe field.



-Hoss


---------------------------------------------------------------------
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