非常适合在其他函数(如 facet.contains)中添加意外参数
?php
$facet = 'title' ;
$str='isto';
$query = new SolrQuery($filter);
$query->setFacet(true)->setShowDebugInfo(true);
$query->addFacetField($facet)->setFacetMinCount(1)->setFacetLimit(200)->setfacetsort(SolrQuery::TERMS_SORT_INDEX);
$query->addparam('facet.contains',$str) ;
?>
// $query->getparams() 的结果 // 检查最后一个
array(8) {
["q"]=> array(1) {
[0]=> string(20) "collection_id_str:61"
}
["facet"]=> array(1) {
[0]=> string(4) "true"
}
["debugQuery"]=> array(1) {
[0]=> string(4) "true"
}
["facet.field"]=> array(1) {
[0]=> string(11) "440a_str_mv"
}
["facet.mincount"]=> array(1) {
[0]=> string(1) "1"
}
["facet.limit"]=> array(1) {
[0]=> string(3) "200"
}
["facet.sort"]=> array(1) {
[0]=> string(5) "index"
}
["facet.contains"]=> array(1) {
[0]=> string(4) "isto"
}
}