很適合在其他函式中新增非預期的參數,例如 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"
}
}