update : 2015.11.03
php.shukuma.com

검색:
 
 
Removes a boost query partial by field name (bq)

SolrDisMaxQuery::removeBoostQuery

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

SolrDisMaxQuery::removeBoostQueryRemoves a boost query partial by field name (bq)

설명

public SolrDisMaxQuery SolrDisMaxQuery::removeBoostQuery ( string $field )

Removes a boost query partial from the existing query, only if SolrDisMaxQuery::addBoostQuery() was used.

인수

field

Field Name

반환값

SolrDisMaxQuery

예제

Example #1 SolrDisMaxQuery::removeBoostQuery() example

<?php

$dismaxQuery 
= new SolrDisMaxQuery("lucene");
$dismaxQuery
    
->addBoostQuery('cat''electronics'5.1)
    ->
addBoostQuery('cat''hard drive')
;
echo 
$dismaxQuery.PHP_EOL;
// now remove a query part with field 'cat'
$dismaxQuery
->removeBoostQuery('cat');
echo 
$dismaxQuery PHP_EOL;

?>

위 예제의 출력 예시:

q=lucene&defType=edismax&bq=cat:electronics^5.1 cat:hard drive
q=lucene&defType=edismax&bq=cat:hard drive

참고