I have two models, named as Products and Variants, in which Variant model have association
with Products as a Product have many Variants. Variant model have field named as
“available_on” … I want to implement search using two dates as check-in n checkout dates.
.
if variants for a product available for each date , check-in date to checkout date, result will map all those products and it is the result….
.
.
guide me how i should give conditions using Sunspot:solr
roughly my models are like this
product
{
product_id integer
has_many variants
}
variant
{
variant_id integer
available_on date
belongs_to product
}
check-in n checkout are the inputs for the search.
it will be easier to answer if you put your models in question but in general way if you have has_many relationship than you should index nested model
if you need to index something from parent
has_manymodel you can use:multiple=>trueoption in this way