Using Terms Query

Hello guys,

I'm looking for some help on the topic Terms Query(URL Available)
"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html".

What I'm trying to do it's something like it's been done on the example above. I'm not being able to understand it clear so where it goes what I'm trying to do.

I wanna be able to present data that I've got in two index like in the example. Can someone explain it to me in a more clear way? What I'm trying to achive, it's a query that giving a certain code, gets a string from another index. If you got questions, or if it's confusing please let me know.

Thanks in advance

Cheers!