What’s the best practice for clearing all or keeping the selected filters after changing the search query?

We are working on a search engine (non- Ecommerce). After changing or editing the search query, should the filters stay selected (assuming the user have the same criteria) or should it be cleared (assuming this is a new search query with different criteria)?