lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chiradeep Vittal <>
Subject Re: Term Frequency within Hits
Date Thu, 08 Mar 2007 18:02:49 GMT
Term Frequency in Lucene parlance = number of occurences of the term within a single document.
If you're looking for "how many documents have term x" where x is unknown, see SimpleFacets
in Solr

----- Original Message ----
From: Erick Erickson <>
Sent: Wednesday, March 7, 2007 2:29:14 PM
Subject: Re: Term Frequency within Hits

See TermFreqVector, HitCollector, perhaps TopDocs, perhaps
TermEnum. Make sure you create your index such that frequencies
are stored (see the FAQ).


On 3/7/07, teramera <> wrote:
> So after I execute a search I end up with a 'Hits' object. The number of
> Hits
> is the order of a million.
> What I want to do is from these Hits is extract term frequencies for a few
> known fields. I don't have a global list of terms for any of the fields
> but
> want to generate  the term frequency based on terms from the Hits.
> Iterating over the hits and doing this later is of course turning out to
> be
> very expensive.
> Is there a known Lucene way of solving such a problem so that this
> calculation happens as the hits are being accumulated?
> Appreciate any pointers,
> --
> View this message in context:
> Sent from the Lucene - Java Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message