"SK R" <[EMAIL PROTECTED]> wrote: > Hi Michael McCandless, > Thanks a lot for this clarification. > Calling writer.flush() before every search is the solution for my > case. > But this may cause any performance issues(i.e) more time or more memory > requirement? > Any idea about time taken for writer.flush()?
It should not increase memory usage; in fact it should decrease it since presumably you are flushing earlier than Lucene normally would. Time to flush also should not vary greatly since one way or another these documents must pay the IO prices to make it to disk. The one sizable difference is you are now creating smaller initial segments than Lucene would normally have created. These segments will then require somewhat more merging which will indeed cost more indexing time over time as the merger must now merge smaller segments together. However, likely this effect is neglible in your application: you really should test the indexing time and see if it actually matters. No need to prematurely optimize. Also, make sure your maxBufferedDocs is <= 10X of how many docs you typically flush otherwise you may hit this still-open issue: http://issues.apache.org/jira/browse/LUCENE-845 For example, don't set maxBuffereDocs to something huge (eg 1000000) else your indexing process will do way too much merging. Mike --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]