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 Darren Govoni <da...@ontrenet.com> on 2008/06/27 19:52:42 UTC

Read index into RAM?

Hi,
   Is it possible to read a disk-based index into RAM (entirely) and
have all searches operate on it there? I saw some RAMDirectory examples,
but it didn't look like it will transfer a disk index into RAM.

thanks
D


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


Re: Read index into RAM?

Posted by Erick Erickson <er...@gmail.com>.
I posted this reply to this question last time you posted it....


>From the docs...

RAMDirectory

public *RAMDirectory*(Directory 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 Fri, Jun 27, 2008 at 1:52 PM, Darren Govoni <da...@ontrenet.com> wrote:

> Hi,
>   Is it possible to read a disk-based index into RAM (entirely) and
> have all searches operate on it there? I saw some RAMDirectory examples,
> but it didn't look like it will transfer a disk index into RAM.
>
> thanks
> D
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Read index into RAM?

Posted by Anshum <an...@gmail.com>.
Hi Darren,
Assuming that you use a *nix/*nux machine, the best way to work that out
would be to have your index moved to a tmpfs. Steps to have that done :
1. Mount a tmpfs  (It uses RAM by default)
2. Copy your index to your new mount point
3. Open your index readers pointing to the new directory location (on tmpfs)

This does the job pretty neat.

--
Anshum Gupta
Naukri Labs




On Fri, Jun 27, 2008 at 11:22 PM, Darren Govoni <da...@ontrenet.com> wrote:

> Hi,
>   Is it possible to read a disk-based index into RAM (entirely) and
> have all searches operate on it there? I saw some RAMDirectory examples,
> but it didn't look like it will transfer a disk index into RAM.
>
> thanks
> D
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
--
The facts expressed here belong to everybody, the opinions to me.
The distinction is yours to draw............