update : 2015.11.03
php.shukuma.com

검색:
 
 
Removes a Query Field (qf parameter)

SolrDisMaxQuery::removeQueryField

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

SolrDisMaxQuery::removeQueryFieldRemoves a Query Field (qf parameter)

설명

public SolrDisMaxQuery SolrDisMaxQuery::removeQueryField ( string $field )

Removes a Query Field (qf parameter) from the field list added by SolrDisMaxQuery::addQueryField()

qf: When building DisjunctionMaxQueries from the user's query it specifies the fields to search in, and boosts for those fields.

인수

field

Field Name

반환값

SolrDisMaxQuery

예제

Example #1 SolrDisMaxQuery::removeQueryField() example

<?php

$dismaxQuery 
= new SolrDisMaxQuery('lucene');
$dismaxQuery
    
->addQueryField('first'3)
    ->
addQueryField('second'0.2)
    ->
addQueryField('cat');
echo 
$dismaxQuery PHP_EOL;
// remove field 'second'
echo $dismaxQuery->removeQueryField('second');
?>

위 예제의 출력 예시:

q=lucene&defType=edismax&qf=first^3 second^0.2 cat
q=lucene&defType=edismax&qf=first^3 cat

참고