erlexec icon indicating copy to clipboard operation
erlexec copied to clipboard

feat: add root_id

Open JohannesMessner opened this issue 3 years ago • 3 comments
trafficstars

Goals:*

This adds .root_id to Document. .root_id is similar to .parent_id, but points all the way to the top, instead of just one chunk-level above.

This is particularly useful in combination with secondary indices, to tie a search back to the top-level document:

best_match = da.find(query=..., secondary_index='@ccc'][0]  # best_match is a chunk of a chunk of a chunk
match_top_level = da[best_match.root_id]  # get top level document

Caution this is a breaking change, since it changed the protobuf definition

JohannesMessner avatar Jul 29 '22 08:07 JohannesMessner