How to write query in sunspot solr

Hi,

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

for following mysql query

select sp.id as id,sp.upc, IF(spu.id IS NULL, p.name, spu.name) as
name, IF(spu.id IS NULL, m2.name, m1.name) manufacturer_name,
IF(spu.id IS NULL, b2.name, b1.name) brand_name,sp.store_id,IF(spu.id
IS NULL, spu.manufacturer_id, p.manufacturer_id) as
manufacturer_id,IF(spu.id IS NULL, spu.brand_id, p.brand_id) as
brand_id,sp.aisle_no,sp.aisle_side_id,sp.section_aisle,sp.shelf_number
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 =
m1.manufacturer_id)
LEFT JOIN product p on (p.upc = sp.upc)
LEFT JOIN manufacturer m2 on (p.manufacturer_id =
m2.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
sp.upc

could any one provide me solution?

thanks,
-pab

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

brand_id,sp.aisle_no,sp.aisle_side_id,sp.section_aisle,sp.shelf_number
sp.upc

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