Search code examples
phpsearchlucenesolrphp-extension

SolR Query using object oriented notation


I have a SolR query like this:

&q=*:*&fq={!geofilt pt=45.15,-93.85 sfield=store d=5}

How can I write the same using SolrQuery() object oriented notation from PHP SolR extension API?


Solution

  • You may always use setParam():

    $query = new SolrQuery();
    $query->setParam('fq', '{!geofilt pt=45.15,-93.85 sfield=store d=5}');