# Loading an index into memory?

**URL:** <https://www.ruby-forum.com/t/loading-an-index-into-memory/127850>\
**Category:** Ferret\
**Created:** [February 1, 2008, 8:49pm UTC](https://www.ruby-forum.com/t/loading-an-index-into-memory/127850 "2008-02-01T20:49:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![plambert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9d8465/32.png) [@plambert](https://www.ruby-forum.com/u/plambert)\
**Post date:** [February 1, 2008, 8:49pm UTC](https://www.ruby-forum.com/t/loading-an-index-into-memory/127850/1 "2008-02-01T20:49:22Z")

</div>

Is there a way to tell Ferret (or AAF) to read an entire index into  
memory, for faster searching? I have small index (3-4 MB) that could be  
kept in memory. Or does Ferret do that automatically?

Thanks,  
–Paul

---

<div class="post-metadata">

**Author:** ![plambert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9d8465/32.png) [@plambert](https://www.ruby-forum.com/u/plambert)\
**Post date:** [February 2, 2008, 4:16pm UTC](https://www.ruby-forum.com/t/loading-an-index-into-memory/127850/2 "2008-02-02T16:16:11Z")

</div>

Hi!

On Fri, Feb 01, 2008 at 08:49:22PM +0100, Paul L. wrote:

> Is there a way to tell Ferret (or AAF) to read an entire index into  
> memory, for faster searching? I have small index (3-4 MB) that could be  
> kept in memory. Or does Ferret do that automatically?

Ferret has an implementation if the Directory interface [1] for  
in-memory  
storage, however you won’t gain much speed (if any) by using it, since  
most operating systems will keep the index in file system buffers anyway  
once it has been used the first time.

[1]  
[http://ferret.davebalmain.com/api/classes/Ferret/Store/RAMDirectory.html](http://ferret.davebalmain.com/api/classes/Ferret/Store/RAMDirectory.html)

Cheers,  
Jens

–  
Jens Krämer  
[http://www.jkraemer.net/](http://www.jkraemer.net/) - Blog  
[http://www.omdb.org/](http://www.omdb.org/) - The new free film database
