0

I need to join data from 2 different indices in elasticsearch. The SQL equivalent of what I need accomplished:

SELECT index1.fieldA, index2.filedB, index1.fieldX, index2.fieldY
FROM index1, index2
WHERE index1.fieldX = index2.fieldY

I found a few elasticsearch/kibana plugins that do this (like siren, timeloin for eg), but I cannot install new software on the server, so I will need a solution that would work without any extra plugins.

I came across a lot of articles that describes creating 'parent-child relationships' but I am not certain how to use it over multiple indexes.

This join would be run only once, so I am not worried about speed/performanc, so is there a way I can do this through a simple json-formatted query?

krzna
  • 185
  • 2
  • 9
  • Possible duplicate of [Join query in ElasticSearch](https://stackoverflow.com/questions/22611049/join-query-in-elasticsearch) – Mišo May 01 '19 at 10:03

1 Answers1

0

If parent child relation is good for you, you can use it and in the query in the index field, put myIndex* instead of myIndex, so now the query will search in myIndex1 and in myIndex2. Alternatively, in the index field you can write myIndex1,my Index2

Lax
  • 1,109
  • 1
  • 8
  • 13
  • There are some discussions I found, like the one here [link](http://stackoverflow.com/questions/18221430/elasticsearch-parent-child-on-differents-indexes) that suggests parent/child relationships with parent and child on different indexes is not possible.. or am I understanding it wrong? – krzna Dec 13 '16 at 23:14