A user has a list of filters that can be applied when retrieving conversations.
A filters has a unique key and a name. The filter wil be applied when
- Fetching conversations from Elasticsearch. This happens in two steps.
First, the conversations are queried using a conversations query.
Any query parameters exposed by the
getParameters()
method are injected into the template.*
Secondly, the latest messages are fetched, using the conversationIds from previous query.
- When a new message is sent, all conversation filters are tested if the message is part of the filter.
This allows for example in a UI to indicate visually where a new message has come into, as a message can belong to multiple filters.
Note that the second bit of logic mimics the filtering done in the Elasticsearch query templates, but is done in Java for performance reasons.