du42561 2011-09-08 17:08
浏览 65

如何使用PHP Solr客户端指定过滤器?

I'm using the PHP Solr client and I want to add a fq (Solr filter query) for this color value: 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.

By calling this URL

select?q=soort_id:19&facet=true&facet.field=closest_rgb&fq=closest_rgb:149,163,166

there are results.

  • 写回答

1条回答 默认 最新

  • duanfen9090 2011-09-08 17:11
    关注

    You need to specify the field name in the fq statement.

    $additionalParameters['fq'] = 'closest_rgb:149,163,166';

    评论

报告相同问题?

悬赏问题

  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥50 汇编语言除法溢出问题
  • ¥65 C++实现删除N个数据列表共有的元素
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波