lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Spencer, Dave" <>
Subject RE: Converting a FSDirectory (on disk index) to a RAMDirectory
Date Fri, 22 Feb 2002 01:43:43 GMT
Have tested it and yes it works.
I'm trying to prove that 
	(a) the jvm eats up more memory and [just to "prove" that it's
putting the index in ram]
	(b) the queries are at least as fast as without using it, esp
when compared to
		a, um, "hot" query (e.g. do same query 2x in a row, 1st
query presumably
		lets lucene cache info, 2nd query is then "hot" and of
interest - if caching
		works well could be same speed as RAMDirectory, would
never expect this
		to be faster).
Am working w/ a 10MB index of around 15k "docs" [index formed from mysql
Will try to report back on the above benchmark/proof - trying to quickly
to Doug w/ a "yes it does work" in answer to his question below.

How to expose this code fragment: I'm in agreement w/ the ctr's below. 
The "requirement" to satisfy would just be that it's easy to convert a
on-disk index into a RAMDirectory. The use case would be a search server
in which
you wanted to eat RAM to have fast responses.

-----Original Message-----
From: Doug Cutting []
Sent: Thursday, February 21, 2002 1:33 PM
To: 'Lucene Developers List'
Subject: RE: Converting a FSDirectory (on disk index) to a RAMDirectory

> From: Spencer, Dave []
> Could anyone glance at this and verify that this code is correct.
> Goal is to convert an existing, on-disk, index to a 
> RAMDirectory, which presumably is purely in memory.

It looks right to me.  Did you test it?  Did it work?

> If the code is correct I'd suggest someone w/ CVS powers adding it to
> the source base - maybe a static method in  RAMDirectory itself.

How about a RAMDirectory constructor?  Since only generic Directory
are required it could just be:

  public RAMDirectory(Directory dirToCopy) { ... }

and, as conveniences:

  public RAMDirectory(File f)   { this(new FSDirectory(f)); }
  public RAMDirectory(String s) { this(new FSDirectory(s)); }


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

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

View raw message