That is how the Advanced Search Filters autocomplete works by default. Clicking a suggestion takes the visitor straight to it: a listing suggestion opens that listing, and a category suggestion opens the category page. The search form is not submitted, so the Near location is not used.
Make category suggestions wait for the search button
In the Advanced Search settings, find the “Category selected action?” option and set it to “Fill in search and await user submit”. A category suggestion then fills the search input and the visitor can add a location before pressing search. There is a matching option for tag suggestions.
Listing suggestions always go directly to the listing.
Other ways to set it up
- Show only category suggestions with the “Show search suggestions with” option set to Categories Only.
- Turn the autocompleter off with “Enable search autocompleter?” and add a category dropdown to the search bar instead. See how to add a filter to the main search bar.
- If you use a category dropdown, you can hide the keyword input with the “Hide Main Search Input” option on the GD > Search block, leaving the category and Near fields.
A single search bar that switches between “search by category” and “search by name” is not built in. You can place two GD > Search blocks set up differently, for example one with the keyword input hidden and one with only the keyword input.