You'll want to use one of the constructors to RAMDirectory that takes
another Directory as a parameter.  In your code, you're just moving around
some object references - at the end the "ram" variable just points to the
instance of FSDirectory.
Sean

On Tue, Jan 20, 2009 at 3:14 PM, David Cummings <dav...@innosphere.ca>wrote:

> As the subject states.
>
> I have a large index (~600mb) stored on the file system and am finding my
> range query is rather slow.
>
> I would like to pull the index into RAM and query against it to compare
> speed.
>
> Does simply doing the following accomplish this:
>
>
>
> Directory ram = new RAMDirectory();
>
> Directory dir = FSDirectory.GetDirectory(path, false);
>
> ram = dir;
>
> IndexSearcher searcher = new IndexSearcher(ram);
>
> .
>
>
>
> If so, I don't notice any difference in performance - my search still takes
> a couple seconds to return .
>
>
>
> Any thoughts?
>
>
>
>

Reply via email to