lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
Subject Re: RAMDirectory vs FSDirectory
Date Tue, 27 Nov 2007 14:52:42 GMT
RAMDirectory has a constructor that takes in another Directory and  
loads it into memory.  No Serialization necessary.  Just index to a  
FSDirectory using Lucene's normal indexing methods (it takes care of  
buffering them internally) and then load the FSDirectory into a  
RAMDirectory.  Have a look at the Javadocs for RAMDirectory to see how  
to do this.

-Grant

On Nov 27, 2007, at 9:36 AM, Haroldo Nascimento wrote:

> You can serialize this object RAMDirectory em disk. When start the
> application , it read the file .ser and load the object in memory.
> The time of load of file .ser is much fast.
> You need change any classes of Lucece: Add the "implements  
> Serialzable" in
> any classes.
>
>
>
> On Nov 27, 2007 4:28 AM, Chhabra, Kapil <kchhabra@akamai.com> wrote:
>
>>> one can improve search performance by using a RAMDirectory created
>> from an underlying FSDirectory using one of the parameterised
>> constructors. Is this correct?
>> Absolutly
>>
>>> Will a FSDirectory not automatically load the index into memory
>> provided enough RAM is available?
>> Not all index files are loaded in the RAM if you are using the
>> FSDirectory. Though at the same time, queries are cached.
>>
>>> Do I have to explicitly use a RAMDirectory?
>> If you want to load the comeplte index in the memory, yes. This  
>> increase
>> the performance a lot as it drastically reduces the number of disk  
>> IO.
>> Obviously at the cost of the RAM. If you have enough RAM available to
>> accommodate the complete index, you can go ahead with this.
>>
>> Regards,
>> kapilChhabra
>>
>> -----Original Message-----
>> From: Hardy Ferentschik [mailto:hardy@ferentschik.de]
>> Sent: Tuesday, November 27, 2007 12:25 PM
>> To: java-user@lucene.apache.org
>> Subject: RAMDirectory vs FSDirectory
>>
>> Hi there,
>>
>> I am using currently a FSDirectory to build my index. The reason for
>> using a file system based index is that a full index rebuild takes
>> around 30 minutes and I want to keep a persistent index.
>> In 'Lucene in Action' I've read that one can improve search  
>> performance
>> by using a RAMDirectory created from an underlying FSDirectory  
>> using one
>> of the parameterised constructors. Is this correct? Will a  
>> FSDirectory
>> not automatically load the index into memory provided enough RAM is
>> available?
>> Do I have to explicitly use a RAMDirectory?
>>
>> --Hardy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>

--------------------------
Grant Ingersoll
http://lucene.grantingersoll.com

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ




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


Mime
View raw message