lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Kor <>
Subject Re: Highlighting terms, new white paper
Date Wed, 17 Oct 2001 01:35:16 GMT

--- Lee Mallabone <> wrote:
> I've just done a whole bunch of code
> browsing/digging, and  it's as you
> suspected - the WildcardQuery.prepare() method must
> be executed so that the
> enum is set correctly. It turns out that this gets
> done when
> is called.
> So I think the summary of this is that
> LuceneTools.getTerms() will crash if
> a query containing wildcards has been parsed but not
> executed?

Yes, that's because PrefixQuery, WildcardQuery and
FuzzyQuery all needs to look through the index to
construct the enum that lists the terms that matches.

MultiTermQuery comes in after that to convert that
enum of terms into a BooleanQuery, which happens in
getQuery(). Thus I don't think null pointer will be
thrown if getQuery is only called after search(). 

In the meantime, I'll put in additional safeguards to
ensure that null pointer isn't thrown if search()
hasn't been called. 

> This certainly isn't the end of the world, but maybe
> it should be noted in
> the docs?

It's already documented. Look at the javadoc for the
MultiTermQuery class. 

Do You Yahoo!?
Make a great connection at Yahoo! Personals.

View raw message