sbp commented on pull request #43:
URL: 
https://github.com/apache/incubator-ponymail-foal/pull/43#issuecomment-857650779


   Yep, exactly. If `a -> b` means that `b` is a reply to `a` then if you have 
two threads:
   
   ```
   8 Jun  a -> b -> c
   9 Jun  d -> e -> f
   ```
   
   Then the `previous` field of `f` is `e`, and the previous field of `e` is 
`d`. But the `previous` field of `d` is `a`.
   
   Because all messages have a `thread` field too, this can indeed be used to 
easily obtain the previous thread of any message. For example, the `previous` 
field of `f` is `e`, but the `thread` field is `d` because that's the top of 
its thread. Therefore to get the previous thread of `f` you'd use `f.thread` to 
get `d` and then `d.previous` to get `a`.
   
   Similarly, to e.g. get all replies to `e` you can just issue an elastic 
query for all messages whose `previous` field is set to `e`. Or to get all 
messages in a thread, just query for all messages whose `thread` field is the 
same as the top of the thread.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to