sharepoint online – how to dynamically change the Content Search Web Part Query in the Share Point 2013 site

In my SP site, documents or list items are taxonomized.
I have an SP page where I added Content Search Web Part and the result is displayed in the Search Results web part when the page loads. Now, when I click on the taxonomy-based top navigation, I want the search results web part to display the results of a well-respected taxonomy based on my navigation click above.

So how do I dynamically change the CSWP query based on the top navigation click?

Thank you in advance.