, , . , , elastics. , , json elasticsearch
def to_model_json
self.document.merge({"sessions" => sessions.as_json}).to_json
end
json elistics , .
,
search_object = Tire::Search::Search::new(Model.index_name, other attributes)
, https://github.com/karmi/tire
,
search_object.filter :range, 'sessions.starts_on' => {:gte => start_date,
:lte => ends_on}