We are working with a large readonly lucene index(single segment) with large 
number of fields and documents and are running into memory usage problems.

We found that when using a ReadOnlyDirectoryReader and IndexSearcher created 
using the same reader, the norms are cached twice - first by the reader itself 
and second by the reader's subreaders. Is there an easy way to avoid having the 
norms cached twice when we only have a single subreader?

We thought of the following options:
1.) pass in the main reader as a subreader when creating the  IndexSearcher?  ( 
e.g. new IndexSearcher(mainReader, IndexReader[] {mainReader}, int[] {0} )
2.) override ReadOnlyDirectoryReader.getSequentialSubReaders() method and 
return null. This tells the IndexSearcher to use the main reader- 
ReadOnlyDirectoryReader.
3.) use SegmentReader.get(boolean, SegmentInfo, int) to create a 
ReadOnlySegmentReader that we use as our main reader instead.

Are there any negative implications to the above approaches? Or are there 
better approaches to the problem?

Thanks in advance for any help.

Alvin Cab
Cengage Learning


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

Reply via email to