Is there any workaround for sorting on multiValued field?

你离开我真会死。 提交于 2019-12-02 13:12:16

Sorting by a multi-valued field is not something that is just pending to do or can be patched.

It can't be possibly done because it simply doesn't make any sense.

The way to do this is to have a single-valued field (populated at index-time with the last date) per document, then sort on that. I.e. when indexing traverse the list of users with their last activity date, find the latest date, and assign it to the document's last-activity-date field.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!