# Searching mutliple indexes with fields?

**URL:** https://discuss.elastic.co/t/searching-mutliple-indexes-with-fields/56229
**Category:** Elasticsearch
**Created:** [July 24, 2016, 8:10am UTC](https://discuss.elastic.co/t/searching-mutliple-indexes-with-fields/56229 "2016-07-24T08:10:25Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![westealinfo](https://avatars.discourse-cdn.com/v4/letter/w/eada6e/32.png) [@westealinfo](https://discuss.elastic.co/u/westealinfo)
#### Post date: [July 24, 2016, 8:10am UTC](https://discuss.elastic.co/t/searching-mutliple-indexes-with-fields/56229/1 "2016-07-24T08:10:25Z")

</div>

Hi,

We are a database look up company. Meaning we A LOT of databases. However, when we first started we thought doing a query to MySQL would be enough. That wasn't the case so we have moved to Elasticsearch. In MySQL, we put all the databases into one database and separated them into tables. So database1 would have its own table and so on. We have imported around 3 tables at this time for testing. When searching all the indexes the speed is impressive but not enough. However, we have the option on our search engine to search for a "username", "email", and "ip". All of the tables has simliar columns. So if database1 has a username column is has "Username" and so on. The spelling is all the same due to this. However some indexes do not have the "Username" function. We were wondering when we send a search request to the API, if we could search all indexes in the "Username" column for a string. So if a user searches "Admin" it would search all indexes that has the column "Username", however we would like to do this by using "localhost:9300/\_all/" instead of specifiying which indexes because we would have over 500.

Thank you! Any suggestions are welcome.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [July 24, 2016, 8:13am UTC](https://discuss.elastic.co/t/searching-mutliple-indexes-with-fields/56229/2 "2016-07-24T08:13:12Z")

</div>

Take a read of [https://www.elastic.co/guide/en/elasticsearch/guide/2.x/multi-index-multi-type.html](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/multi-index-multi-type.html)

---

<div class="post-metadata">

### Author: ![westealinfo](https://avatars.discourse-cdn.com/v4/letter/w/eada6e/32.png) [@westealinfo](https://discuss.elastic.co/u/westealinfo)
#### Post date: [July 24, 2016, 8:16am UTC](https://discuss.elastic.co/t/searching-mutliple-indexes-with-fields/56229/3 "2016-07-24T08:16:33Z")

</div>

Hi,

We have tried that and we don't get any results but this.

`{ "took": 18, "timed_out": false, "_shards": { "total": 20, "successful": 20, "failed": 0 }, "hits": { "total": 0, "max_score": null, "hits": [] } }`

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [July 24, 2016, 9:27am UTC](https://discuss.elastic.co/t/searching-mutliple-indexes-with-fields/56229/4 "2016-07-24T09:27:58Z")

</div>

Providing the query you ran would be helpful.

---

<div class="post-metadata">

### Author: ![westealinfo](https://avatars.discourse-cdn.com/v4/letter/w/eada6e/32.png) [@westealinfo](https://discuss.elastic.co/u/westealinfo)
#### Post date: [July 24, 2016, 9:29am UTC](https://discuss.elastic.co/t/searching-mutliple-indexes-with-fields/56229/5 "2016-07-24T09:29:52Z")

</div>

I will mark this as solved.  
For future readers I will explain how I did it.

I was reading the doucmentatry for 2.3 and I noticed that one of the documents said  
"GET /megacorp/employee/\_search?q=last\_name:Smith" as a example and the result was that it searched teh field "lastName" for smith. So I just simply executed  
"GET /\_all/\_search?q=Email:admin@gmail.com" and I got the results correctly.

I hope this helps someone and I would really reccomend reading the guide even though it's long it is very helpful.

Thank you!

---

<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 5, 2017, 10:33pm UTC](https://discuss.elastic.co/t/searching-mutliple-indexes-with-fields/56229/6 "2017-07-05T22:33:19Z")

</div>


