Can't clear cached search results

Hi,


I would appreciate some help or advice if anyone has come across a similar issue.



Using 3.18



I have set up a trigger to clear the cache (inc. dependents) of a search page when a new asset of type X is made live.



This way, the search results should always include the most recent additions.



It appears to work fine fine for empty searches (the recent addition is always shown on the results page if I run an empty search) - but if I search on a metadata field, then the clear cache trigger does not clear the cache of the filtered results (IE the recent addition is NOT shown on the results pages).

I know the trigger is working (I set up an email response).

I know it's not a browser cache issue or a local proxy issue.

We are not using any proxy server for caching (EG Squid) either.



As a logged in user I can see the non cached, filtered results pages (only public user caching is ON) - and adding /_nocache in the search string successfully bypasses the Matrix cache to show the latest additions in the filtered search results.



I have also tried manually cearing the cache using all of the available tools and settings (cache manager and clear cache tool)



So, in essence it would appear that

A) Clearing the cache of a search page does not clear the cache of the results pages (unless running an empty search)



I would appreciate any advice anyone would be able to give.



Q. Does Matrix store a cache of the specific results URL - EG:

    http://www.mysite.com/search?queries_query=test&search_page_123456_submit_button=Search&current_result_page=1&results_per_page=20&submitted_search_category=&mode=


I ask as I have also noticed that different URLs produce different results (I would have thought they all preformed the search again if the cache had been cleared or expired).
EG:
    http://www.mysite.com/search?queries_query=test

might be cached, whereas:
    http://www.mysite.com/search?queries_query=test&search_page_123456

might not be...

Sorry for the mammoth first post, hopefully there is a simple explanation.

Karl

You may need to clear the cache for the Search Manager asset as well - under the System Management folder. It stores raw results across the entire system so many search pages benefit from a shared cache of word searches.

Hi Greg, thanks for the tip.


The only way I can see to clear the cache of the search manager is to use the 'cache expiry' screen of the cache manager asset, select the type code and change the default expiry time (I was going to set it at 1hr).

None of the other options either allow me to select the search manager node, or select the search manager type.



Before I do so, just a couple of queries


  1. Does clearing the search manager cache affect the indexing of the site (IE: does it then need to re-index the site)?
  2. Can you think of any other nasty side-effects from doing this?



    Thanks again



    Karl

No, clearing cache has no impact on indexing. The only side-effect is that new searches take longer.

Thanks - done more testing & have a solution - results and thoughts as follows:

  1. In cache expiry screen of cache manager - turned the cache OFF for asset type code "SEARCH MANAGER"
  2. Set up the trigger to clear the cache of the specific "SEARCH PAGEs" when new asset added.



    Interestingly, after turning off the cache for the search manager, the search pages continue to cache the results of a search, until the specific search page itself has the cache cleared manually or by trigger.



    I still don't fully understand the logic of the search manager storing search results for specific terms site-wide - but it seems to be working as I want.

    IE: - search results are cached until a new item is added.



    Thanks again for your help.