Im writing a function to handle multiple queries in a boolean AND search.
I have a dict of docs where each query occurs= query_dict
I want the intersection of all values in the query_dict.values():
query_dict = {'foo': ['doc_one.txt', 'doc_two.txt', 'doc_three.txt'],
'bar': ['doc_one.txt', 'doc_two.txt'],
'foobar': ['doc_two.txt']}
intersect(query_dict)
>> doc_two.txt
I've been reading about intersection but I'm finding it hard to apply it to a dict.
Thanks for your help!