Search two indexes and update

Hi,

I'm using ES 1.7, and I have 2 indexes:

  1. names & address
  2. address list

I want to compare this two, and if the address from index 1 exits in index 2, an additional field will be added to index 1 stating that the address exists.

For example:
name => "John Snow", address => "Winterfell"

Now if the address "winterfell exists in index 2, than index one will change to:
name => "John Snow", address => "Winterfell", exists => "True"
Otherwise:
name => "John Snow", address => "Winterfell", exists => "False"

How do you recommend to do this?

Thanks

You cannot do this via any direct ES queries, you'd need to do this entirely in code, external to ES.