# Searching/filtering index B using all field.values from index A

**URL:** <https://discuss.elastic.co/t/searching-filtering-index-b-using-all-field-values-from-index-a/205773>\
**Category:** Elasticsearch\
**Created:** [October 30, 2019, 1:21am UTC](https://discuss.elastic.co/t/searching-filtering-index-b-using-all-field-values-from-index-a/205773 "2019-10-30T01:21:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bug\_tester](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bug_tester/32/47744_2.png) [@bug\_tester](https://discuss.elastic.co/u/bug_tester)\
**Post date:** [October 30, 2019, 1:21am UTC](https://discuss.elastic.co/t/searching-filtering-index-b-using-all-field-values-from-index-a/205773/1 "2019-10-30T01:21:55Z")

</div>

i'm new to elastic stack and trying to figure out how to approach this problem.

I have two index **A**** B**. data is being fed into them regularly

index **A** has many fields including a _ **model** _ field with model name  
{"model" : "HK781" , .........}  
{"model": "CK542" , ........}

index B has many fields including receiptLog with text data  
{"receiptlog":"random text data _CK542_ random text data", ..............}  
{"receiptlog": "random text data random text data ", ..................}

I want to search or filter(if possible) **index B** based on all the keywords from **index A**'s **model** field.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 31, 2019, 1:02pm UTC](https://discuss.elastic.co/t/searching-filtering-index-b-using-all-field-values-from-index-a/205773/2 "2019-10-31T13:02:22Z")

</div>

You would need to execute two searches (or even worse n+1 searches).

Maybe there is a chance to unify our data model, so that you end up with a single document?

Maybe explaining the use-case a bit more would also help. What problem are you trying to solve, what exactly is the user searching for? A bit more context for understanding seems very helpful from my perspective.

---

<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:** [November 28, 2019, 1:02pm UTC](https://discuss.elastic.co/t/searching-filtering-index-b-using-all-field-values-from-index-a/205773/3 "2019-11-28T13:02:27Z")

</div>

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