开发者

How to filter solr result with multiple parameter

开发者 https://www.devze.com 2023-03-17 17:50 出处:网络
How to filter solr result with multiple parameter. I am using Zend_Service_Solr class for my solr search extension.开发者_如何转开发

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

精彩评论

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