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: highlighting - fuzzy search
Date Wed, 05 Apr 2006 05:18:38 GMT


: > Well, a roundabout way is to simply create a FuzzyQuery, rewrite it,
: > cast it to a BooleanQuery and use the BooleanQuery API to extract the
: > TermQuery objects and the Term within the TermQuery has what you're
	...

: We take an approach somewhere down the middle...
	...
:      FuzzyQuery q = ...
	...
:      FilteredTermEnum enum = q.getEnum(reader);
	...
: In fact our own code takes any query and looks at the type of it to
: extract terms from it, potentially recursively if it encounters a
: BooleanQuery.  It would be Really Nice [TM] if Lucene had a method on
: the Query class to do this directly. :-)

Isn't that what Query.extractTerms is for?  Isn't it implimented by all
primitive Queries, so you should be able to say...

	HashSet terms = new HashSet();
	query.rewrite(reader).extractTerms(terms);

...and have yourself a list of all the terms?



-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