1-3 are really answered by the same explanation: When you open a searcher, lucene "knows" what all the closed segments are (i.e., the last commit point). And you can't commit when only part of a document has been written to the current segment. You can think of commits as atomic at the document level. At least they'd better be or it's a serious bug.
Until you open a new searcher that view of the index is kept. All add/delete/update operations since you opened that searcher do NOT operate on that view of the index. New updates are written to new segments which aren't part of that view. Deleted docs are marked as deleted, but the currently open searcher doesn't have a clue about those. When searchers are closed, any segments that have been "merged away" are deleted from disk. And since when a new searcher is opened, it only sees closed segments, there should be no way to get partial docs. In that sense, add/updated/delete indexing operations are atomic. 4> Sure. In fact all of the 4 possibilities are possible for stored=T|F, indexed=T|F, although stored=false and indexed=false is essentially a no-op. Best, Erick On Tue, Aug 11, 2015 at 4:20 AM, Yechiel Feffer <yechi...@gigaspaces.com> wrote: > Hi > 1. as I understand Lucene is preparing the documents of the search result in > a lazy fashion- using the docId in the ScoreDoc. What happens if the > document "pointed" by the ScoreDoc is deleted meanwhile i.e. the DocId is > not relevant (maybe assigned to a different document) ? > 2. when a document is added to an index- (addDocument) I guess there is a > period in which the fields are added to the index one by one. What prevents > an indexsearcher (esp' in NRT mode) to see "half" document , i.e is it > atomic and how? > 3 The way to update doc is remove the old and add the updated. Isnt there a > problem of a "hole" between the remove & the addDocument in which no document > exists , i.e is it atomic and how? > 4 is it possible to store a field in the lucene index without indexing it ? > (i.e. just gettng it back in the result docs) > > Thanks, > Yechiel > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org