Did you try this?

byte [] buffer = new byte [100] ;
LuceneUtils.copy(fsDir, ramDir, buffer);


Kalani

On Wed, Aug 13, 2008 at 6:26 AM, Darren Govoni <[EMAIL PROTECTED]> wrote:

> Hello,
>  The kind sir below recommended the RAMDirectory for loading an on-disk
> index into memory (the entire data) and using IndexSearcher off that. It
> seemed to worked very well.
>
> On one index, I am seeing no speed change when flipping between
> RAMDirectory IndexSearcher and file system version.
>
> Creating the RAMDirectory from the on-disk index only takes 0.09
> seconds. It appears it is not loading the data into memory, but maybe
> just the file names of the index?
>
> How can I load an on-disk index - the data - into memory and run
> searches there?
>
> thanks for any help. you guys are awesome!
> D
>
> On Thu, 2008-06-26 at 15:47 -0400, Erick Erickson wrote:
> > >From the docs...
> >
> > RAMDirectory
> >
> > public *RAMDirectory*(Directory
> > <file:///C:/lucene-2.1.0/docs/api/org/apache/lucene/store/Directory.html>
> > dir)
> >              throws IOException
> > <http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html>
> >
> > Creates a new RAMDirectory instance from a different
> > Directoryimplementation. This can be used to load a disk-based index
> > into memory.
> >
> > Seems like exactly what you're asking for...
> >
> > Best
> > Erick
> >
> > On Thu, Jun 26, 2008 at 3:40 PM, Darren Govoni <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hi,
> > >  Is there a lucene index reader that will load a disk-based index into
> > > memory and perform searches on it from RAM? Sorry if I missed this in
> > > the docs somewhere.
> > >
> > > Darren
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Kalani Ruwanpathirana
Department of Computer Science & Engineering
University of Moratuwa

Reply via email to