Take a look at the HighFreqTerms sample class in contrib...
http://svn.apache.org/viewcvs.cgi/lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/HighFreqTerms.java?rev=376393&view=log ...it doesn't meet your goal, because it returns a list of terms that appear frequently in the whol index, not just in the results of a query. But if you use a HitCollector (or a Filter) to generate a BitSet of all your results, and if you modified HighFreqTerms to only count Terms where the TermDocs contains a result in your BitSet ... then you'll be really close to what you want. (I say really close because it's only going to suggest individual Terms, not "phrases" in the sense of something that would match a PhraseQuery containing multiple Terms ... but you could allways index word ngrams of various sizes so they would count as individual Terms) Depending on the number of Terms in your idnex, and the number of results in a typical search, you may be better of storing the term vectors for each doc, iterating over the matches and using the TermFreqVector.getTerms(), Acctually, that's probably faster in all cases. : Date: Mon, 13 Feb 2006 17:34:58 +0800 : From: Chun Wei Ho <[EMAIL PROTECTED]> : Reply-To: java-user@lucene.apache.org : To: java-user@lucene.apache.org : Subject: Suggesting refine searches with Lucene : : Hi, : : I am trying to suggest refine searches for my Lucene search. For : example, if a search turned out too many searches, it would list a : number of document title subsequences that occurred frequently in the : results of the previous search, as possible candidates for refining : the search. : : Does anyone know the right/any approach to implementing this in a : Lucene-based search app? : : Thanks. : : CW : : --------------------------------------------------------------------- : To unsubscribe, e-mail: [EMAIL PROTECTED] : For additional commands, e-mail: [EMAIL PROTECTED] : -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]