. ( OP), . , "" .
Facebook ( - Elasticsearch)

: ( Messages )
, :
: ( )
:
, , , conversation ( ). , . ( doc).
conversation ( , , , ).
{
"ID" : 317,
"participant_ids": [123456789, 987654321],
"participant_names: ["John Doe", "Jane Doe"],
"last_message_snippet" : " Lorem ipsum dolor sit amet, consectetur adipiscing elit...",
"last_message_timestamp" : "timestamp of the last received message",
}
b/c, , .
, , [ ] participant_ids last_message_timestamp.
typeahead, Elasureearch Term Suggestester participant_names.
conversation (vs message) , .
Index Per Timeframe ( , , , ).
conversation message, , conversation
{
"ID" : 4828274,
"conversation_id": 317,
"conversation_participant_ids": [123456789, 987654321],
"sender_id": 123456789,
"sender_name: "John Doe",
"message" : " Lorem ipsum dolor sit amet, consectetur adipiscing elit",
"message_timestamp" : <timestamp>,
}
, , conversation_id message_timestamp.
message. ( Facebook).
, [ ] conversation_participant_ids message_timestamp.
, , Elasticsearch routing ( ), , conversation_id routing .
. Elasticsearch , . conversation message , "" Elasticsearch.
Elasticearch , , Elasticsearch - .
Messaging , , - , , , - " ", , "" , .