# Search multiple documents

**URL:** <https://discuss.elastic.co/t/search-multiple-documents/363655>\
**Category:** Elasticsearch\
**Created:** [July 23, 2024, 6:42pm UTC](https://discuss.elastic.co/t/search-multiple-documents/363655 "2024-07-23T18:42:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![raymondtam](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@raymondtam](https://discuss.elastic.co/u/raymondtam)\
**Post date:** [July 23, 2024, 6:42pm UTC](https://discuss.elastic.co/t/search-multiple-documents/363655/1 "2024-07-23T18:42:38Z")

</div>

I have 2 indexes - People and Vehicles. Index "People" has a field "IsVisible" while index "Vehicles" does not have this property.

Now I want to search "Raymond" on these 2 indexes. However, the search only happens on "People" index for "IsVisible" field with value of true. Other records are irrelevant to this search. All records in "Vehicles" index are inclusive to the search.

I cannot use "Filter" on the search results as I need to return 100 records at all times.

I have tried all combination of "querystring", "match", "term", "bool" and cannot find the right query that giving the above condition.

Please advise on how to resolve this.

Regards

---

<div class="post-metadata">

**Author:** ![Musab\_Dogan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/musab_dogan/32/70691_2.png) [@Musab\_Dogan](https://discuss.elastic.co/u/Musab_Dogan)\
**Post date:** [July 24, 2024, 8:10pm UTC](https://discuss.elastic.co/t/search-multiple-documents/363655/2 "2024-07-24T20:10:50Z")

</div>

You should merge two indices into one index. You can do that outside of the elasticsearch or you can use [enrich processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-setup.html).

To use enrich processor you should have a correlation\_id (eg. an `id` field that has in both indices).

![image](https://us1.discourse-cdn.com/elastic/original/3X/d/b/db35abd0ecc2e804a6fc2843ab5298a034a6373d.png)

Note: Performing full SQL-style joins in a distributed system like Elasticsearch is prohibitively expensive. Because of that the inner join query not exist in Elasticsearch.
