elasticsearch/elasticsearch — Issue #1416: Indices for search can only be specified at request-level, not query-level
Author: poblish
Created: 2011-10-21 12:11:18+00:00
State: open

Currently, searches only allow one set of indices to be specified across the entire query, but it would be helpful to allow `BoolQueryBuilder`-style subqueries to be able to specify their own indices as well, something Compass used to support, and for ES to deal with the aggregation. In other words, add `setIndices(String... indices)` to `QueryBuilder`, rather than just having it on `SearchRequestBuilder`. This would allow UNION-style queries to be built up, of the form:

"return all hits where property=X in (indexA,indexB) OR property=Y in (indexA,indexC)"