Smart selection of documents