I've list of queries and list of documents like this
queries = ['drug dosage form development Society', 'new drugs through activity evaluation of some medicinally used plants', ' Evaluation of drugs available on market for their quality, effectiveness']
docs = ['A Comparison of Urinalysis Technologies for Drugs Testing in Criminal Justice', 'development society and health care', 'buying drugs on the market without prescription may results in death', 'plants and their contribution in pharmacology', 'health care in developing countries']
I want to print document as related one if at least one similar word exists in both query and document. I've tried this code based on one answer of python: finding substring within a list post. but it did not work.
query = [subquery for subquery in queries]
for i in query:
sub = i
for doc in docs:
if str(i) in docs:
print docs
any help is appreciable