Update URL with QueryParameters

Hi,

I have a search form and want to add the search parameters as query parameters to the URL.
I already do that and have multiple ways developed in the past but I’m looking for the most generic way to do that.

Any suggestions?

Thanks, Simon