[support] Drupal 7 apache solr search filer ...

Kamal Palei palei.kamal at gmail.com
Thu May 23 08:59:16 UTC 2013


Looks it is impossible to have two OR queries in single fq filter.
Has anybody done this previously?

Thanks
kamal


On Thu, May 23, 2013 at 12:46 PM, Chandra Shekhar
<chandrashekhar at srijan.in>wrote:

> http://wiki.apache.org/solr/SolrQuerySyntax
>
>
>
> On Thu, May 23, 2013 at 12:28 PM, Kamal Palei <palei.kamal at gmail.com>wrote:
>
>> Dear All
>> I am trying to write a search filter for a field having a value in a
>> range or a specific value.
>>
>> Say if I want to have a filter like
>> 1. Select profiles with salary 5 to 10  or Salary 0.
>>
>> So I expect profiles having salary either 0 , 5, 6, 7, 8, 9, 10 etc.
>>
>> To do this, I have written code as below.
>>
>>
>>     $index = 0;
>>     if($include_0_salary == 1)
>>     {
>>         $conditions['fq'][$index++] = 'salary:[' . $min_ctc . '+TO+' .
>>         $max_ctc . ']+OR+salary:0';
>>     }
>>     else
>>     {
>>         $conditions['fq'][$index++] = 'salary:[' . $min_ctc . ' TO ' .
>> $max_ctc . ']';
>>     }
>>
>>     $results = apachesolr_search_search_execute($keys, $conditions);
>>
>> When $include_0_salary is false, it gives me expected result. When
>> $include_0_salary is true, solr server crashes.
>>
>> I am sure, the way I am setting the fq param, is not proper. Has somebody
>> done this previously, kindly help, suggest me whats the right syntax.
>>
>> Thanks
>> kamal
>>
>> --
>> [ Drupal support list | http://lists.drupal.org/ ]
>>
>
>
>
> --
> Warm regards,
> Chandra Shekhar
>
> Srijan Technologies Pvt. Ltd.
> 303 Solitaire Plaza,
> Near Guru DronaCharya Metro station
> Gurgaon -122002
> Haryana
> website : www.srijan.in
>
> Wordpress : http://ananddhara.wordpress.com
> Twitter : http://twitter.com/ananddhara
> Scribd : http://www.scribd.com/ananddhara
> Facebook : http://www.facebook.com/ananddhara
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20130523/092243ce/attachment-0001.html 


More information about the support mailing list