solr中多值字段的特定值排序
我有一个 Solr 索引,它将日期存储在每个文档的多值字段中。
我需要能够搜索日期范围(已完成),而且还要按日期对结果集进行排序,其中日期是属于该范围的多值字段的第一个日期。
如果我尝试使用函数进行排序,它会告诉我它不能在多值字段上使用 Field Caceh。
是否可以让函数填充查询上的字段,然后按该字段或其他选项进行排序,或者唯一的选择是使用联接,按联接排序,然后字段折叠。
由于搜索的复杂性和连接的数量,我真的无法使用 SQL,因此希望有一种方法可以完成此操作,而无需退回到类似 SQL 的范例。
I Have a Solr index that stores dates in a multivalued field for each document.
I need to have the ability to search for a date range (done that), but also sort the result set by date where the date is the first date of the multivalued field that falls within the range.
If I try to use a function for sorting it will tell me that it can not use the Field Caceh on multivalued fields.
Is it possible to maybe have a function fill a field on the query and then sort by that, or another option, or would the only option be to use a join, order by the join and then field collapse.
I really can't use SQL due to the complexity of the search and the number of joins, so was hoping there was a way I could complete this without falling back to SQL-like paradigms.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试将多个文档添加到索引,每个文档都有一个值。然后,按日期排序,并按文档分组。
You can try to add multiple documents to the index, each with a single value for the document. Then, sort by the date and group by the docid.