Save search settings whenever the dialogue is closed.