solr 查询 排序

Querying Data
查询没什么可说的。大致看看就明白。
q
是查询关键字。fl是返回哪些结果集的字段。结果集是一个xml文档。

引用


Searches are done via HTTP GET on the select URL with the query string in the q parameter. You can pass a number of optional request parameters  to the request handler to control what information is returned. For example, you can use the "fl" parameter to control what stored fields are returned, and if the relevancy score is returned...

    * q=video&fl=name,id (return only name and id fields)
    * q=video&fl=name,id,score (return relevancy score as well)
    * q=video&fl=*,score (return all stored fields, as well as relevancy score)
    * q=video&sort=price desc&fl=name,id (add sort specification: sort by price descending)


Solr provides a query form within the web admin interface that allows setting the various request parameters and is useful when trying out or debugging queries.



Sorting

排序也很简单。sort关键字。

引用


Solr provides a simple method to sort on one or more indexed fields. Use the 'sort' parameter to specify "field direction" pairs...

引用

    * q=video&sort=price desc
    * q=video&sort=price asc
    * q=video&sort=inStock asc, price desc

"score" can also be used as a field name when specifying a sort...

    * q=video&sort=score desc
    * q=video&sort=inStock asc, score desc



If no sort is specified, the default is score desc, the same as in the Lucene search APIs.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值