Please wait while we load your page...
 

Announcements

PHP Manual :: SolrDisMaxQuery::addBoostQuery



SolrDisMaxQuery::addBigramPhraseField || SolrDisMaxQuery::addPhraseField || SolrDisMaxQuery || PHP Manual

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

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

Description

public SolrDisMaxQuery SolrDisMaxQuery::addBoostQuery ( string $field , string $value [, string $boost ] )

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

Parameters

field

value

boost

Return Values

SolrDisMaxQuery

Examples

Example #1 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::addBigramPhraseField || SolrDisMaxQuery::addPhraseField || SolrDisMaxQuery || PHP Manual
Live Chat Not Available