How to write query in sunspot solr


I am  using sunspot solr for search i which i need to write query

for following mysql query

select as id,sp.upc, IF( IS NULL,, as
name, IF( IS NULL,, manufacturer_name,
IF( IS NULL,, brand_name,sp.store_id,IF(
IS NULL, spu.manufacturer_id, p.manufacturer_id) as
manufacturer_id,IF( IS NULL, spu.brand_id, p.brand_id) as
from sal_products sp
LEFT JOIN store_product_upcs spu on (spu.upc = sp.upc and
spu.store_id = sp.store_id)
LEFT JOIN manufacturer m1 on (spu.manufacturer_id =
LEFT JOIN product p on (p.upc = sp.upc)
LEFT JOIN manufacturer m2 on (p.manufacturer_id =
LEFT JOIN brand b1 on (spu.brand_id = b1.brand_id)
LEFT JOIN brand b2 on (p.brand_id = b2.brand_id) group by

could any one provide me solution?


On Feb 17, 6:26am, Pab [email protected] wrote:


could any one provide me solution?

No, nobody is going to be able to provide you a solution when you’ve
provided no information about how the data is stored in Solr…

–Matt J.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs