# Elastic Search - Query multiple indices

**URL:** <https://discuss.elastic.co/t/elastic-search-query-multiple-indices/17542>\
**Category:** Elasticsearch\
**Created:** [May 15, 2014, 4:48pm UTC](https://discuss.elastic.co/t/elastic-search-query-multiple-indices/17542 "2014-05-15T16:48:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CC1](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@CC1](https://discuss.elastic.co/u/CC1)\
**Post date:** [May 15, 2014, 4:48pm UTC](https://discuss.elastic.co/t/elastic-search-query-multiple-indices/17542/1 "2014-05-15T16:48:08Z")

</div>

Hi! I have data stored in 3 indices that I want to query, but these indices  
have different fields. If I try it like this:

curl -X GET '[http://host:9200/myindex1,myindex2,myindex3/\_search?pretty](http://host:9200/myindex1,myindex2,myindex3/_search?pretty)' -d  
'{"query":{"bool":{"must":[{"query\_string":{"query":"myquery","default\_operator":"AND"}},  
{"range":{"due\_date":{"from":"2011-11-30T19:09:06.275Z","to":"2013-07-07T02:52:37.012Z"}}}]}},  
"facets":{"facet1":{"terms":{"field":"text\_content", "size":100}}}}'

the results returned by ElasticSearch refer only to the first index, namely  
myindex1. Another issue is that I really need to filter these results by  
due\_date, but only myIndex1 contains this field. The text\_content field can  
also vary per index, i.e that in myindex2 and myindex3 it has got a  
different name.

How can I achieve my purpose using ElasticSearch? Many thanks!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e911d3e5-1213-46bb-8ca2-04b411b04abf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e911d3e5-1213-46bb-8ca2-04b411b04abf%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:29am UTC](https://discuss.elastic.co/t/elastic-search-query-multiple-indices/17542/2 "2017-07-06T01:29:05Z")

</div>


