How to make a negative connection request in ES

I have 2 indexes in my Elasticsearch setup.

  • index_a
  • index_b

index_a has a location field and has about 1000 documents, where index_b has a city field and has about 600 documents.

I want to find out all locations from index_a that are not in the city field in index_b . What request should I fulfill to achieve the above?

+5
source share
1 answer

You perform two queries: select "all the necessary information" from index_b , then search index_a using "info" from index_b .

Elasticsearch cannot "join" in any way to two indexes in one query and prefers to have denormalized data or use nested or parent-child relations.

+3
source

Source: https://habr.com/ru/post/1242355/


All Articles