# Show suggestion from different indexes of elasticsearch?

**URL:** https://discuss.elastic.co/t/show-suggestion-from-different-indexes-of-elasticsearch/138484
**Category:** Elasticsearch
**Created:** [July 4, 2018, 6:18am UTC](https://discuss.elastic.co/t/show-suggestion-from-different-indexes-of-elasticsearch/138484 "2018-07-04T06:18:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rs123](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rs123](https://discuss.elastic.co/u/rs123)
#### Post date: [July 4, 2018, 6:18am UTC](https://discuss.elastic.co/t/show-suggestion-from-different-indexes-of-elasticsearch/138484/1 "2018-07-04T06:18:27Z")

</div>

Suppose I have two indexes in elasticsearch. First `names` contains five documents with values `Ram, Shyam, Hari, Dipu, Kishan` and second `profession` contains five documents with values like `teacher, driver, doctor, bank manager, salesman`. When someone types `Ra`, I want to show suggestions like

```
Ram is teacher
Ram is driver
Ram is doctor
Ram is bank manager
Ram is salesman

```

Similarly when someone types `Har`, I want to show

```
Hari is teacher
Hari is driver
Hari is doctor
Hari is bank manager
Hari is salesman

```

I don't want to store every possible combination. Also suppose user is looking for `Ram is a doctor at Raman Hospital since 2002`. Here `Ram`, `doctor`, `Raman Hospital`, `2002` belongs to different-different indexes. When user types `Ram` I want to show suggestions as `Ram is a teacher at Basic Boys School Since 2002`, `Ram is salesman at HUL since 2006`. And if there is one more guy with name `Raman` then `Raman is driver at Ola since 2012` should also be shown as suggestion. For such searches is there any good approach available or I have to work on that?  
I'm using elasticseach.js API.

---

<div class="post-metadata">

### Author: ![rs123](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rs123](https://discuss.elastic.co/u/rs123)
#### Post date: [July 8, 2018, 3:55pm UTC](https://discuss.elastic.co/t/show-suggestion-from-different-indexes-of-elasticsearch/138484/2 "2018-07-08T15:55:27Z")

</div>

Anyone?

---

<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: [August 5, 2018, 3:55pm UTC](https://discuss.elastic.co/t/show-suggestion-from-different-indexes-of-elasticsearch/138484/3 "2018-08-05T15:55:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
