lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Searching missing documents after doing an addIndexes
Date Mon, 22 May 2006 19:39:48 GMT

: Can anyone clarify this behavior, i.e., why does search not find
: recently added documents unless I close and re-open it?

this is by design .. an IndexReader (and hence an IndexSearcher) maintain
consistent views of the index at the moment they were open by hanging on
to the open filehandles and segment information.  no changes made to the
index after they've been open ever show up in that instance (but they will
show up in other instances you open after those changes.

the two main reasons for this behavior that i know of are:

  1) it gives yo ua consistent view for as long as you want it -- you can
choose when you get to see updates.
  2) it allows the IndexReader to maintain caches of information (like the
FieldCache and CachingWrapperFilter for example .. i'm sure there are
other peices of information that get cached, but i can't think of
specifics off the top of my head)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message