vttranlina commented on PR #1477:
URL: https://github.com/apache/james-project/pull/1477#issuecomment-1465414287

   > Please do a similar for OpenSearch search index too!
   
   The OpenSearch index did that. 
   
   Quote `ListeningMessageSearchIndex.java`
   ```java
       private Mono<Void> handleAdded(MailboxSession session, Mailbox mailbox, 
Added added) {
           return Flux.fromIterable(MessageRange.toRanges(added.getUids()))
               .concatMap(range -> retrieveMailboxMessages(session, mailbox, 
range))
               .publishOn(Schedulers.parallel())
               .concatMap(mailboxMessage -> add(session, mailbox, 
mailboxMessage))
               .then();
       }
   
       private Flux<MailboxMessage> retrieveMailboxMessages(MailboxSession 
session, Mailbox mailbox, MessageRange range) {
           return factory.getMessageMapper(session)
               .findInMailboxReactive(mailbox, range, FetchType.FULL, 
UNLIMITED);
       }
   ```
   The `MailboxSessionMapperFactory factory` query db for latest MailboxMessage


-- 
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.

To unsubscribe, e-mail: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to