I am using Tire for implementing Elasticsearch. My environment is Linux,Rails 3.2 with Ruby 1.9.3. I am able to index using Elasticsearch with the help of gem Tire(0.5.8). But now to improve performance i want to get the data to be displayed from indexed data and not hit Database(i want to use db for INSERT and UPDATE only).
To achieve this i am using below code:
result = Tire.search 'jobs', load: true do
query do
string "is_active:1"
end
filter :range, status: {gte: 0 }
sort { by :created_at, 'desc' }
end
return result.results
Since i am using load:true it hits database(MySQL) which i do not want.But i am removing the load attribute then it gives me no result. I am able to check that all of the columns of mentioned table is indexed("xxx:9200/jobs/_mapping?pretty=1").
Please suggest how can i achieve it.
Thanks.