当前位置:伍佰目录 » 站长资讯 » 站长资讯 » 推广策划 » 文章详细

PHP - Manual: SolrDisMaxQuery::removeBoostQuery

来源:网络转载 浏览:552次 时间:2023-03-20
SolrDisMaxQuery::removePhraseField » « SolrDisMaxQuery::removeBigramPhraseField PHP 手册 函数参考 搜索引擎扩展 Solr SolrDisMaxQuery

SolrDisMaxQuery::removeBoostQuery

(No version information available, might only be in Git)

SolrDisMaxQuery::removeBoostQuery — Removes a boost query partial by field name (bq)

说明

public SolrDisMaxQuery::removeBoostQuery(string $field): SolrDisMaxQuery

Removes a boost query partial from the existing query, only if SolrDisMaxQuery::addBoostQuery() was used.

参数

field

Field Name

返回值

SolrDisMaxQuery

范例

示例 #1 SolrDisMaxQuery::removeBoostQuery() example

<?php

$dismaxQuery = new SolrDisMaxQuery("lucene");
$dismaxQuery
    ->addBoostQuery('cat', 'electronics', 5.1)
    ->addBoostQuery('cat', 'hard drive')
;
echo $dismaxQuery.PHP_EOL;
// now remove a query part with field 'cat'
$dismaxQuery
->removeBoostQuery('cat');
echo $dismaxQuery . PHP_EOL;

?>

以上例程的输出类似于:

q=lucene&defType=edismax&bq=cat:electronics^5.1 cat:hard drive
q=lucene&defType=edismax&bq=cat:hard drive

参见

SolrDisMaxQuery::addBoostQuery() - Adds a boost query field with value and optional boost (bq parameter) SolrDisMaxQuery::setBoostQuery() - Directly Sets Boost Query Parameter (bq)
add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/solrdismaxquery.removeboostquery.php


伍佰目录声明:本站部分文章来源于网络,版权属于原作者所有。如有转载或引用文章/图片涉及版权问题,请联系我们处理.我们将在第一时间删除! 联系邮箱:tsk@qq.com

快速链接

最新收录

最新点入