php solr q.op,Solr的一些查询参数

本文详细介绍了Solr查询中的关键参数,如fl、defType、q、q.alt、qf、pf、fq、mm、ps、qs、tie、bq和bf等,以及它们在构建和优化查询时的作用。通过理解这些参数,可以更有效地定制搜索结果,实现精确的查询匹配和评分提升。同时,文章还提到了输出格式和查询逻辑的设置选项,如wt、q.op、df和qt。
摘要由CSDN通过智能技术生成

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 words close 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.5wt: writer type,指定输出格式,可以有 xml, json, php, phps。

q.op: 覆盖schema.xml的defaultOperator(有空格时用"AND"还是用"OR"操作逻辑)。

df: 默认的查询字段。

qt: query type,指定那个类型来处理查询请求,一般不用指定,默认是standard。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
HTTP 错误 503 "Service Unavailable" 表示服务器暂时无法处理请求,可能是由于服务器过载、正在进行维护或是资源不可用等状态引起的。当你尝试访问网站或API服务时遇到这个错误提示,通常意味着服务当前无法正常响应你的请求。 这种错误可能由多种原因引起: 1. **服务器负载过高**:当服务器处理的请求过多,超过了其能够承受的负载能力时,可能会返回 503 错误。 2. **服务器维护**:如果服务器正在接受维护或升级,它可能暂停接收请求并返回 503 错误。 3. **资源耗尽**:比如内存不足、数据库连接数达到上限等情况也可能导致服务器无法响应请求。 解决方法: - **等待一段时间后再试**:许多情况下,服务器会在短时间内恢复正常工作,稍候再次尝试请求或许可以成功。 - **检查服务状态**:通过查看服务提供商的状态页面或者相应的监控系统,了解是否有已知的服务中断情况。 - **联系技术支持**:如果问题是持续性的,应考虑与服务提供者联系,报告问题,并询问可能的原因及预计修复时间。 - **优化请求策略**:对于频繁请求服务的情况,可以考虑是否需要调整请求频率或采用缓存策略减轻服务器压力。 相关问题: 1. 503错误如何影响用户体验? 2. 遇到503错误时,开发者应该采取哪些步骤? 3. 如何预防服务器过载导致的503错误发生?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值