Combining data from two indexes with common field (ID)

Hello All,

I have two different indexes, one contains a list of items, along with their ID, something like:

Items:

itemID: int
itemName: text
itemDescription: text

Second index contains orders with a reference to that item and looks like this:

Orders:

orderID: int
orderPrice: float
ItemID: int

I would like to create an index or a visualization that will combine information from both indexes, the result would look like this:

Orders Detailed:

orderID: int
orderPrice: float
ItemID: int
itemName: text
itemDescription: text

The source data is pulled using logstash. The source of Items is a flat file and is a sort of a dictionary updated few times a day. Orders is a transactional data pulled by jdbc every minute.
Is that something that can be achieved using Elasticsearch?

Hey,

joining two indices at query time is not supported. However what about joining these two data structures at index time, so that it is simple to query them? You could embed the ordered items in the order, this way everything is just a query away.

--Alex

Hello @spinscale,

Thank you for the answer. I'm not sure how i could join two structured at index time. Could you shed some more light on that topic or point where I could find more information about this approach so that I could study it? I'd appreciate that.

Thanks!

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