lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alf Eaton <>
Subject Re: Stemmed terms/common terms
Date Thu, 16 Aug 2007 16:51:47 GMT
On 16 Aug 2007, at 15:17, Alf Eaton wrote:
> - Is there a way to get a list of all the terms in the index (or  
> maybe just the top n) ordered by descending frequency of usage? I  
> imagine it's related to docFreq, but can't see how to get a list of  
> terms in all documents.

Thanks to I worked out how to do this (to  
get a list of terms and their frequency) with PyLucene:

terms = reader.terms()
   term = terms.term()
   if term.field() == 'title':
     print '%s - %d' % (term.text(), reader.docFreq(term))


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

View raw message