Just call the interactive function `counsel-ag-popup' and use the popup to configure the search.