略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: SolrDisMaxQuery::addBoostQuery

2024-11-13

SolrDisMaxQuery::addBoostQuery

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

SolrDisMaxQuery::addBoostQueryAdds a boost query field with value and optional boost (bq parameter)

说明

public SolrDisMaxQuery::addBoostQuery(string $field, string $value, string $boost = ?): SolrDisMaxQuery

Adds a Boost Query field with value [and boost] (bq parameter)

参数

field

value

boost

返回值

SolrDisMaxQuery

范例

示例 #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

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

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

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3