设为首页 收藏本站
查看: 983|回复: 0

[经验分享] Solr的一些查询参数

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-7-16 14:10:06 | 显示全部楼层 |阅读模式
  fl: 是逗号分隔的列表,用来指定文档结果中应返回的 Field 集。默认为 “*”,指所有的字段。
  defType: 指定query parser,常用defType=lucene, defType=dismax, defType=edismax
  q: query。
  q.alt: 当q字段为空时,用于设置缺省的query,通常设置q.alt为*:*。
  qf: query fields,指定solr从哪些field中搜索。
pf: 用于指定一组field,当query完全匹配pf指定的某一个field时,来进行boost。
简言之pf的作用是boosting phrases over words。
  fq: filter query,过虑查询。
  mm: minimal should match。Solr支持三种查询clause,即“必须出现”, “不能出现”和“可以出现”,分别对应于AND, -, OR。
  在默认情况下,使用OR这个clause。mm用于设置在使用OR这个clause时,需要出现最少的满足条件的clause数量,详见这里。
ps: Phrase Slop. Amount of slop on phrase queries built for "pf" fields (affects boosting). ps is about pf parameter. ps affects boosting, if you play with ps value, numFound and result set do not change. But the order of result set change. This is about the phrase query that is constructed out of the entire "q" param. ps is slop applied to the phrases created from the entire query for evaluating pf boosts. ps will only (potentially) change the ranked ordering of your result set, by loosening what a "phrase match" means to the pf boost.
ps的例子:

Lets say your query is apache solr. (without quotation marks)
Lets say these three documents contains all of these words and returned.
1-) solr is built on the top of apache lucene.
2-) apache solr is fast, mature and popular.
3-) solr is hosted under apache umbrella.
Even if you don't use pf and ps parameters, those documents will be in result set anyway. Lets say that they appear in this order 1,2,3.
Then we include pf and ps parameter, q=apache solr&pf=title^1.2&ps=1
Second document is boosted, lets say it comes first now. The order is changed. The documents - that have the all query wordsclose each other - are boosted. Again the same three documents are returned.
qs: Query Phrase Slop. Amount of slop on phrase queries explicitly included in the user's query string (in qf fields; affects matching). qs affects matching. If you play with qs, numFound changes. This parameter is about when you have explicit phrase query in your raw query. i.e. &q="apache lucene" . qs is slop applied to phrases explicitly in the &q with double quotes. qs will (potentially) change your result set.
  tie: tie breaker。
  bq: 对某个field的value进行boost,例如brand:IBM^5.0。
  bf: Function (with optional boosts) that will be included in the user's query to influence the score. Any function supported natively by Solr can be used, along with a boost value, e.g.: recip(rord(myfield),1,2,3)^1.5
  wt: writer type,指定输出格式,可以有 xml, json, php, phps。
  q.op: 覆盖schema.xml的defaultOperator(有空格时用"AND"还是用"OR"操作逻辑)。
df: 默认的查询字段。
qt: query type,指定那个类型来处理查询请求,一般不用指定,默认是standard。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-87369-1-1.html 上篇帖子: 1.jdk、Tomcat、solr的安装和配置 下篇帖子: solr高亮设置以及摘要
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表