SolrDisMaxQuery::addBoostQuery

(No version information available, might only be in Git)
Adds a boost query field with value and optional boost (bq parameter)
public SolrDisMaxQuery SolrDisMaxQuery::addBoostQuery ( string $field, string $value [, string $boost ] )

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

Parameters:
field

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

value

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

boost

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

Returns:

SolrDisMaxQuery

Examples:
SolrDisMaxQuery::addBoostQuery() example
<?php

$dismaxQuery = new SolrDisMaxQuery("lucene");
$dismaxQuery
    ->addBoostQuery('cat', 'clothing', 2)
    ->addBoostQuery('cat', 'electronics', 5.1)
;
echo $dismaxQuery.PHP_EOL;
?>

The above example will output something similar to:

q=lucene&defType=edismax&bq=cat:clothing^2 cat:electronics^5.1
See also:

SolrDisMaxQuery::removeBoostQuery() -

SolrDisMaxQuery::setBoostQuery() -

doc_php
2016-02-24 16:11:44
Comments
Leave a Comment

Please login to continue.