I'm using an observer on the event "controller_action_postdispatch_catalogsearch_result_index" to redirect the user to a landing page if their search query matches one of a number of specific phrases exactly.

This works as intended except that if a phrase is matched and the user redirected, the search query continues to run in the background even though it's now superfluous, thereby slowing down the website.

I'd like to know if there's a way to halt the query immediately, ideally from the observer, or if not by another method.

I look forward to your feedback.

  • 1
    Why are you waiting until after the dispatch to check the data submitted by the user? Why wouldn't you check in predispatch and redirect if necessary? – Brett Jan 16 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.