首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

SolrDisMaxQuery::removeBoostQuery

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

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

Description

代码语言:javascript
复制
public SolrDisMaxQuery SolrDisMaxQuery::removeBoostQuery ( string $field )

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

Parameters

field

Field Name

Return Values

SolrDisMaxQuery

Examples

Example #1 SolrDisMaxQuery::removeBoostQuery() example

代码语言:javascript
复制
<?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;

?>

The above example will output something similar to:

代码语言:javascript
复制
q=lucene&defType=edismax&bq=cat:electronics^5.1 cat:hard drive
q=lucene&defType=edismax&bq=cat:hard drive

See Also

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

← SolrDisMaxQuery::removeBigramPhraseField

SolrDisMaxQuery::removePhraseField →

代码语言:txt
复制
 © 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券