Manohar
Manohar

Reputation: 67

Does Lucene's inverted index is stored in memory?

I am working on a project where I am using Solr for data retrieval. To my knowledge, Solr uses Lucene internally. And Lucene creates an Inverted Index. And this index is stored in several files in file system as mentioned in the documentation - http://lucene.apache.org/core/3_0_3/fileformats.html#Inverted%20Indexing

I am curious to know how this works while searching. Does the inverted index will be loaded and kept in memory so that it doesn't need to go to file system. If not, is there a way I can keep this in memory so that my search can be much faster.

Upvotes: 0

Views: 664

Answers (1)

mindas
mindas

Reputation: 26713

You can use RamDirectoryFactory but this is considered inefficient, especially for larger indexes - mainly because of GC overhead.

You're better off tuning various Solr caches which are designed to achieve the same result.

Upvotes: 0

Related Questions