Add a new function used to generate search query