开发者

How to filter solr result with multiple parameter

How to filter solr result with multiple parameter. I am using Zend_Service_Solr class for my solr search extension.

开发者_如何转开发

I can query all result by

$searchQuery[] = '*:*';
$solr->search(($searchQuery), $startRow, $limit, array());

Now I would like to filter with multiple filter parameters like name, city, zipcode at a time

Tried as,

$searchQuery[] = 'zip_code:'.$zip_code;
$searchQuery[] = 'city:'.$city;
$searchQuery[] = 'name:'.$name;

$solr->search($searchQuery, $startRow, $limit, array());

but fails. Any idea how to get the desired output


try:

$searchQuery->addFilterQuery('zip_code:'.$zip_code);
$searchQuery->addFilterQuery('city:'.$city);
$searchQuery->addFilterQuery('name:'.$name);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜