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)User Contributed Notes
There are no user contributed notes for this page.官方地址:https://www.php.net/manual/en/solrdismaxquery.removeboostquery.php
伍佰目录声明:本站部分文章来源于网络,版权属于原作者所有。如有转载或引用文章/图片涉及版权问题,请联系我们处理.我们将在第一时间删除!
联系邮箱:tsk@qq.com