Script Look and research (6.2)

Hi,
Let's say that I have two index. "Main" and "Daily".
Main contain a lot of field but is almost never updated.
Daily contain few field but is frequently subject to update.

Could I use a script to look for an entity wich got "field26" : "Arthur", then take the "ID" of this entity and look for it in Daily which got this ID as a foreign key?

Thus having access to Daily knowing only one field of Main in a single query.

Thank You.

Scripts operate within elasticsearch in very specific contexts. For example, there are scoring scripts that manipulate the scores of documents as they are collected during search. They are meant to be small pieces of code which have limited access to other systems (for example, networking). What you describe sounds like a join. You should do this client side; doing so in elasticsearch (whether in a script or not) will not be any more efficient.

1 Like

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