Changes to return id of the document in the resultset