【问题标题】:Having problem with solr query syntaxsolr 查询语法有问题
【发布时间】:2011-03-31 14:15:50
【问题描述】:

我从大约 2 到 3 天就开始使用 solr PHP 的每个人,到目前为止,这一切都很好,但是在排序和随机记录方面存在一些问题,我也使用 Lucene 语法,这是查询

(cf_title: nokia OR cf_description: nokia) AND (cf_power_ad: 1 OR cf_power_deal: 1) AND cf_city : Lahore AND sort : cf_addeddate desc

有人可以帮我整理和随机记录吗?谢谢!!!

【问题讨论】:

    标签: php sorting lucene solr


    【解决方案1】:

    排序顺序不应作为查询的一部分给出,而应作为名为 sort 的单独参数给出。 请看这个:http://lucene.apache.org/solr/tutorial.html#Sorting

    要获得随机排序顺序,您应该使用 RndomSortField,如下所述: http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-12
      • 2011-10-31
      • 1970-01-01
      • 2023-03-30
      相关资源
      最近更新 更多