lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bamford <>
Subject Open IndexReader read-only
Date Mon, 08 Dec 2008 12:17:32 GMT

Can someone guide me please?

I have inherited a Lucene application and am attempting to update the 
API from 2.0 to 2.4.
I note that the 2.4 CHANGELOG talks of opening an IndexReader with 
read-only=true to improve performance.  Does anyone know how to do this?
I have been combing my predecessor's fully working code, and cannot find 
/anywhere/ where an IndexReader is actually opened!  He seems to do this 
sort of thing instead:

First he instantiates a DelayCloseIndexSearcher object, passing it a 
Directory object. (I think he got DelayCloseIndexSearcher off the net - 
according to the Javadoc, the author was Luc Vanlerberghe??). 
He then accesses the IndexReader like so:

        IndexReader reader = *searcher.getIndexReader()*;
        TermEnum te = reader.terms();

So does that mean if you don't explicitly open an IndexReader, the 
IndexSearcher will do it for you?  Or what?


- Chris

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message