SELECT *, if(user_to = :current_user, user_from, user_to) AS recipient FROM im WHERE
user_to = :current_user OR user_from = :current_user
GROUP BY recipient
ORDER BY dttm DESC
SELECT * FROM im WHERE
user_to = 2 OR user_from = 2
GROUP BY GREATEST(user_to, user_from), LEAST(user_to, user_from)
ORDER BY dttm ASC
user_id (с кем чат?)
message (текст последнего сообщения)
dt_created (дата последнего сообщения)
"doc['floors'] < 10"
Cannot apply [<] operation to types [org.elasticsearch.index.fielddata.ScriptDocValues.Longs] and [java.lang.Integer].