[support] Drupal 7 apache solr search filer ...
Chandra Shekhar
chandrashekhar at srijan.in
Thu May 23 07:16:05 UTC 2013
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/2180e034/attachment.html
More information about the support
mailing list