开发者

Having problem with solr query syntax

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜