略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: SolrDisMaxQuery::removeQueryField

2024-12-22

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 noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/solrdismaxquery.removequeryfield.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3