SolrDisMaxQuery::addBoostQuery
(No version information available, might only be in Git)
SolrDisMaxQuery::addBoostQuery — Adds a boost query field with value and optional boost (bq parameter)
説明
public SolrDisMaxQuery::addBoostQuery(string
$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
参考
- SolrDisMaxQuery::removeBoostQuery() - Removes a boost query partial by field name (bq)
- SolrDisMaxQuery::setBoostQuery() - Directly Sets Boost Query Parameter (bq)
+add a note
User Contributed Notes
There are no user contributed notes for this page.
↑ and ↓ to navigate •
Enter to select •
Esc to close
Press Enter without
selection to search using Google