PHP 8.4.1 Released!

SolrDisMaxQuery::removeQueryField

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

SolrDisMaxQuery::removeQueryFieldRemoves a Query Field (qf parameter)

説明

public SolrDisMaxQuery::removeQueryField(string $field): SolrDisMaxQuery

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

例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

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top