Added optimization to compute similarity for document if atleast one query token exists in document