With very small indexes and no sort fields (eg. you just use relevance)
loading an IndexReader does not take very long. I think it does always
make sense to cache it and reuse it though - unless the index has
changed, there is no reason to pay the price of opening a new
IndexReader. As your index grows, and especially if you sort on fields,
the price of 'warming' a new IndexReader can get quite high.
However, if memory is an issue, you might not cache just so that its not
guaranteed that all of your IndexReaders for each index will be in
memory at the same time - this is not a great solution to your memory
problem though - if all indecies are ever searched at the same time,
you will need to be able to accommodate that many IndexReaders in RAM
anyway.
- Mark
Mohsen Saboorian wrote:
Hi,
I have a set of indices in different languages (very smal indices: on
average each index directory has 10,000 documents, which has an overall size
of less than 2mb). I want to know if this is a good idea to cache
IndexReader (once opened) somewhere and further reuse it? My application is
single-threaded, but I have memory concerns, since the indexing and search
is totally done on client machines.
Does it make sense to have all IndexReaders cached (for example if opening
an index reader takes some time). Does Lucene load some part of index in
memory as soon as a call to IndexReader.open() is done?
Mohsen.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]