Multi-index Searching in ElasticSearch (Tire) Multi-index Searching in ElasticSearch (Tire) elasticsearch elasticsearch

Multi-index Searching in ElasticSearch (Tire)


regarding Tire, there's an important distinction: are you using it standalone or in the ActiveRecord/ActiveModel integration.

In the former case, just search against multiple indices, Tire.search ['indexA', 'indexB'] do ... end. Or search against the whole cluster, Tire.search do ... end (equivalent to curl 'http://localhost:9200/_search?q=*').

In the latter case, Tire does not handle multi-model searches well, at the moment. Notice this pull request: https://github.com/karmi/tire/pull/218 -- build your gem with this patch applied and help test out the solution.

UPDATE

Current Tire (> 0.4) can load multiple model instances just fine. See the integration test for example.


I'm pretty sure that the http://127.0.0.1:9200/_search endpoint will do the trick for you. Over 99% of my data is in one index, so its hard for me to verify this for you here.

Also, check out the multi-search endpoint: http://www.elasticsearch.org/guide/reference/api/multi-search.html