views:

20

answers:

0

I tried act_as_solr_reloaded plugin for searching option in my project I have two models which are brand and sku and its association are

class Brand < ActiveRecord::Base acts_as_solr :include => [:skus],:fields => [:id,:name,:description,:active] end

class Sku < ActiveRecord::Base acts_as_solr :include => [:brand],:fields => [:id,:name,:description,:brand_id,:active{:price=>:range_float},{:date => :date}] end

i can able to make multi search with single model like

@query = "(name:foo^10) (description:foo^5) (tags:foo)" Model.find_by_solr(@query, :start => 0, :rows => 10)

but I want to form a condition from multiple models like brands.active='true' and skus.active='true and brands.id=skus.brand_id and skus.date between 'from date' and 'to date'

I don't know how to form multiple model search with date range. pls help me how to make search like above using act_as_solr_reloaded by exmaple

Thanks