You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ryan O'Hara <oh...@genome.chop.edu> on 2006/08/02 22:35:17 UTC

Re: Fastest Method for Searching (need all results)

eks dev,

The most best way of looping through all results that I have come  
across is using a HitCollector and grabbing the field values via  
FieldCache.  This is under two conditions:  1) The FieldCache arrays  
are initialized only once, since creating these arrays creates  
serious overhead, especially if you have millions of documents in  
your index.  I use Tomcat as my application server, so the way I  
accomplished this was I created a Listener class that extends  
ServletContextListener.  This way, when Tomcat restarts, the  
contextInitialize method in the Listener class is executed,  
initializing the arrays only once.  These arrays are then accessible  
to all users across all sessions.  2)You have enough RAM to store the  
arrays.  If you are dealing with millions of documents, you can  
easily use up hundreds of megabytes of RAM, so keep this in mind.   
Just thought I would let you know how I made out.  Thanks again.

Ryan

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org