Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sorting 如何按日期结果排序?:Solr_Sorting_Solr - Fatal编程技术网

Sorting 如何按日期结果排序?:Solr

Sorting 如何按日期结果排序?:Solr,sorting,solr,Sorting,Solr,我正在按日期对结果进行排序。服务器正在使用Solr技术。早些时候,我使用了: urldata.sort = 'last_modified desc'; 按日期对结果进行排序。现在它似乎不起作用了。它抛出错误: 我参考了Solr中关于按日期排序的回答: 我试图将“last_modified desc”更改为“published_date desc”,但似乎不起作用。如何继续解决此错误?此错误与排序无关,但您没有在特定字段中搜索任何特定值。由于URL中没有定义或指定默认字段,Solr不知道如何处

我正在按日期对结果进行排序。服务器正在使用Solr技术。早些时候,我使用了:

urldata.sort = 'last_modified desc';
按日期对结果进行排序。现在它似乎不起作用了。它抛出错误:

我参考了Solr中关于按日期排序的回答:


我试图将“last_modified desc”更改为“published_date desc”,但似乎不起作用。如何继续解决此错误?

此错误与排序无关,但您没有在特定字段中搜索任何特定值。由于URL中没有定义或指定默认字段,Solr不知道如何处理搜索

尝试在URL中设置
df
,查询特定字段
foo:value
或使用
qf
(带(e)dismax)指定Solr应排序的字段


只要字段被指定为日期字段,排序就应该自动工作。

只需尝试urldata.sort=last\u modified desc;(不是字符串格式)