Added function query_sample() to get a list of size N*total with the text of a random sample.