using iteration approach to get documents
sending request and handling them. updateIndex() missing
search works.