lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <>
Subject Re: Getting only the Ids, not the whole documents.
Date Fri, 03 Aug 2007 00:33:59 GMT
On Thursday 02 August 2007 19:28:48 Mohammad Norouzi wrote:
> you should not store them in an Array structure since they will take up the
> memory.
> the BitSet is the best structure to store them

You can't store strings in a BitSet.

What I would do is return a List<String> but make a custom subclass of 
AbstractList<String> which creates the strings on demand from the Hits 
object.  We use similar tricks to convert Hits into a List of another more 
complex object type and it works great.  You can cache the strings as they're 
retrieved if you're planning to use some strings much more than others.


Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web:                               Fax: +61 2 9212 6902

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

View raw message