builds search query based on date and location