build search query uri, create history of queries