lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: raw hit count
Date Sun, 30 Nov 2003 16:24:09 GMT
On Sunday, November 30, 2003, at 11:13  AM, Kent Gibson wrote:
> as per Erik's idea I tried with the BitSet as follows:
> QueryFilter qf = new QueryFilter(query);
> IndexReader ir =;
> Searcher searcher2 = new IndexSearcher(ir);
> // get the bit set for the query
> BitSet bits = qf.bits(ir);

I did not mean to imply for you to call the bits method in this manner. 
  In fact, you should not call it - the IndexSearcher calls it under the 
covers.  I was implying that you could write your own Filter subclass 
that lit up a single-bit corresponding to the document you're 
interested in.

> However I always get a result of 1, which I suppose is
> has to do with this overlap thingy.

No, not related with respect to a filter - two different concepts.

> Is there not a simple way to just get some word
> statistics out of a file?

Look at the Lucene index format (from Lucene's main web page).  Term 
frequencies are part of the statistics gathered, of course.  You can 
get at the values there using IndexReader.  This may be a lot 
lower-level than you desire, but what Lucene stores is there for you.


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

View raw message