Added document id as a value
Added DISTINCT to search distinct documents by collapsing them