for efficiency I suggest that this be done as:
fetch all the texts - _copy_nodes_graph
after that, use nodes to generate a set of referenced texts
text_refs = set()
text_keys = set()
for index, key, value, references in nodes:
if references[1]: text_refs.update(references[1]) text_keys.add(key)
Then filter that by the keys copied
external_refs = text_refs - text_keys
Now look up external_refs in self._pack_collection.text_index.combined_index
found_items = list(self._pack_collection.text_index.combined_index.iter_entries(external_refs))
if len(found_items) != len(external_refs):
identify the missing ones here.
for efficiency I suggest that this be done as:
text_ refs.update( references[ 1])
text_ keys.add( key)
fetch all the texts - _copy_nodes_graph
after that, use nodes to generate a set of referenced texts
text_refs = set()
text_keys = set()
for index, key, value, references in nodes:
if references[1]:
Then filter that by the keys copied
external_refs = text_refs - text_keys
Now look up external_refs in self._pack_ collection. text_index. combined_ index _pack_collectio n.text_ index.combined_ index.iter_ entries( external_ refs))
found_items = list(self.
if len(found_items) != len(external_refs):
identify the missing ones here.
-Rob