lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Query.extractTerms
Date Sat, 10 Dec 2005 00:02:40 GMT
: Query.extractTerms throws an exception if called with a non-rewritten
: query. Is it enough to document that (I could do that) or is that
: something that should be fixed (if possible)?

That seems like something that should be a checked Exception (not a

Alternately, extractTerms could take in an IndexReader and do it's own
rewriting.  (it's new since 1.4.3 so there's no major harm in changing the

: BTW, the API is "public void extractTerms(Set)", wouldn't this be more
: natural?: public Set extractTerms()

The advantage of having the Set passed in is that the client can choose
it's own implementation based on it's intended use (ie: if i'm going to
iterate over the results in multiple threads, i may want a
CopyOnWriteArraySet; if i just want fast lookups, i may want a HashSet).
Not to mention the fact that this way, if i want a the set of all terms in
many, many Queries, i can use the method as is to keep adding the terms
into a single set, instead of getting back several and merging them later.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message