[英]How to specify a filter with the PHP Solr client?
I'm using the PHP Solr client and I want to add a fq
(Solr filter query) for this color value: 149,163,166
我正在使用PHP Solr客户端,并且要为此颜色值添加一个fq
(Solr过滤器查询): 149,163,166
$additionalParameters['facet'] = 'true';
$additionalParameters['facet.mincount'] = 0;
$additionalParameters['facet.limit'] = 25; // default = 100
$additionalParameters['facet.field'] = array(
'closest_rgb',
'price'
);
$additionalParameters['fq'] = '149,163,166';
$obj_results = $obj_solr->search($search_query, $int_offset, $int_limit, $additionalParameters);
Did I forget something? 我忘记了什么吗? Because I don't any get results with the PHP client. 因为我没有通过PHP客户端获得任何结果。
By calling this URL 通过调用此URL
select?q=soort_id:19&facet=true&facet.field=closest_rgb&fq=closest_rgb:149,163,166
there are results. 有结果。
您需要在fq语句中指定字段名称。
$additionalParameters['fq'] = 'closest_rgb:149,163,166';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.