Hi Sergi,

Take a look at TermEnum and TermDocs in the API. You will have to iterate over these, summing as you go.

You could also, during indexing, store these counts external to Lucene as you come across the term during the Analysis phase.

Sergi Fernandez wrote:
Hi there, I'm new in Lucene, and I just know to index a corpus, and run a query. I thought I can count the times that a word appears in the whole corpus with a simple query, but it seems to be not so easy. Somebody knows how to do it?
Many Thanks!

Sergi Fernandez.

--

Grant Ingersoll Sr. Software Engineer Center for Natural Language Processing Syracuse University School of Information Studies 335 Hinds Hall Syracuse, NY 13244 http://www.cnlp.org Voice: 315-443-5484 Fax: 315-443-6886

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to