Elasticsearch - equivalent of LEFT JOIN -


i have 20,000,000 line items in elasticsearch happily searching (it's working amazingly well).

there added dimension though don't know how solve:

a user can "buy" items (in batches of 1,000 100,000) , need search return items have not "bought". i'd solve left join in sql.

i add boughtby[] field each item, need update lots of documents every time user buys. feels kind of wrong?

elasticsearch uses lucene supports blockjoin. in elasticsearch parent-child relationships. gives join comes limitations (it's no longer possible arbitrarily distribute documents across nodes, memory requirements can explode in scenarios).

elasticsearch documentation gives a nice overview of relationship modelling options.

if need deep joins, more complex relationships, etc., might consider looking siren plugin.

(disclaimer: work company develops siren)


Comments