PHP - Manual: SolrDisMaxQuery::addBoostQuery
2024-12-22
(No version information available, might only be in Git)
SolrDisMaxQuery::addBoostQuery — Adds a boost query field with value and optional boost (bq parameter)
$field
, string $value
, string $boost
= ?): SolrDisMaxQueryAdds a Boost Query field with value [and boost] (bq parameter)
field
value
boost
示例 #1 SolrDisMaxQuery::addBoostQuery() example
<?php
$dismaxQuery = new SolrDisMaxQuery("lucene");
$dismaxQuery
->addBoostQuery('cat', 'clothing', 2)
->addBoostQuery('cat', 'electronics', 5.1)
;
echo $dismaxQuery.PHP_EOL;
?>
以上例程的输出类似于:
q=lucene&defType=edismax&bq=cat:clothing^2 cat:electronics^5.1
官方地址:https://www.php.net/manual/en/solrdismaxquery.addboostquery.php