Thanks for the explanation!!  I thought that if a record is contained in 
the transaction log, it would not be part of a sement.  But as soon as we 
flush the transaction log, it re-indexes the changes into the segment and 
then commits to disk.  But it sounds that a record can be both in the 
transaction log as well as in the lucene segment itself but in-memory. 
 That sounds believable :)   I'm trying to come up with a data model that 
would be efficient for a Customer record that can have many transactions. 
I've ruled out inner objects, nested objects, and now tinkering with 
Parent/Child or complete denormalization.

Thanks again Binh!!

On Wednesday, February 26, 2014 1:46:14 PM UTC-8, Binh Ly wrote:
>
> Thanks, I think I understand better now. I deleted my previous post so 
> that I can clarify better. The transaction log is just a backup mechanism 
> for durability. When you index a document, it eventually goes into a 
> segment (in memory). When you update it, the old doc is marked as deleted 
> and then a new one is indexed into a/the segment. If no flush/commit has 
> been made so far, the documents/segments are still in memory and each 
> operation is also recorded in the transaction log (one for the first index, 
> and then another for the update, and so on). When you do a flush, the 
> in-memory segments are then written to disk and then the transaction log is 
> emptied out (since we no longer need it as "backup" at this point). If on 
> the other hand you simply do a refresh, the "new" segments in memory are 
> simply made searchable (even though they are not necessarily written to 
> disk yet) and no flush to disk happens. In this case, the transaction log 
> still contains whatever it had in it so far.
>
> So to answer your question, each update will require a new document to be 
> indexed (no way around it). And the transaction log is probably not 
> something that would matter in your scenario. I hope that helps. :)
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/ba73b0e0-6c57-4205-8bbd-c0a27a69de38%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to