开发者

Having problem with solr query syntax

开发者 https://www.devze.com 2023-02-20 18:17 出处:网络
Everyone I have started working with solr PHP from about 2 or 3 days this is working perfect so far but having some issues with the sorting and random records, Also im using Lucene syntax, Here is the

Everyone I have started working with solr PHP from about 2 or 3 days this is working perfect so far but having some issues with the sorting and random records, Also im using Lucene syntax, Here is the query

(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

开发者_Go百科

Can some one please help me with the sorting and random records?, Thankyou!!!


Sort order should be given not as part of the query but as separate parameter named sort. Please take a look at this: http://lucene.apache.org/solr/tutorial.html#Sorting

To get random sort order you should use RndomSortField as described here: http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html

0

精彩评论

暂无评论...
验证码 换一张
取 消