我对 Solr 7.0.0 以及结合 [subquery] 进行排序操作有疑问:
我有两个集合:
- 集合A:用于静态数据
- Collection B:对于经常更新的数据,它与Collection B具有相同的ID。
我通过 fl=*,foo:[subquery] 合并了两个集合的结果。生成的响应看起来像这样:
{
"twda_names":["TWA"],
"id":"TWA-2017-000",
"file_loc":["Other"],
"file_name":["Other"],
"file_type":["Other"],
"doc_type":["Other"],
"_version_":1583236633578176512,
"twda_names_str":["TWA"],
"foo":[
{
"views":21,
"id":"TWA-2017-000",
"_version_":1583236633716588544}]},
{
"id":"TWA-2017-001",
"twda_names":["TWRWRW"],
"file_loc":["Other"],
"file_name":["Other"],
"file_type":["Other"],
"doc_type":["Other"],
"_version_":1583237084210003968,
"twda_names_str":["TWRWRW"],
"foo":[
{
"id":"TWA-2017-001",
"views":99,
"_version_":1583237084347367424}]}]
现在我想根据现场 View 进行排序,但似乎无法正常工作..
到目前为止我尝试了什么:
- &sort=faa:[subquery]asc 并指定 &faa.q 等....导致错误
- &sort=childfield(views) ...错误
- &sort={!func}query($qq) 和指定 &qq={!dismax qf=id} 等...错误
非常感谢任何建议!
谢谢,蒂姆
最佳答案
没办法。您可能可以在查询时使用评分 {!join ..}.. 参见 https://lucene.apache.org/solr/guide/7_1/other-parsers.html#join-parser-scoring
关于sorting - Solr - 如何基于子查询进行排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47127478/