1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do I Link seach results?

Discussion in 'Troubleshooting and Problems' started by Eliteoomph, Jul 30, 2011.

  1. Eliteoomph

    Eliteoomph Member

    Hey guys,

    I have a site that revolves around giving and taking items. I am trying to create an easy way for people to search for available items. Right now the best thing that I have come up with is to include certain text in the post title of new available items. I then search the forum for those keywords and check search titles only to get a list of all new available items. This seems to work ok for now except I have one problem. When new items are added I am noticing that the link will no longer work properly.


    It seems that when there is a difference in the number of results, that the number 408 above changes... I am thinking that this is the 408th search because the number always seem to go up but I am not sure. So my problem is that if the result number changes but I do not update the link every time (which is becoming a real pain in the butt) then the search will not return all of the correct results.

    How can I get around this?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You are correct in your assumption, every search has a unique, sequential ID.
    Linking to that search will just show the cached results.

    I'm not sure there is an easy way around it.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You are correct. It caches previous searches for one hour.

    I examined the search code and there is no option to disable caching unless you enable debug mode which is not something you want to do for a live forum.

    You can manually clear the cache by running this query:

    TRUNCATE TABLE xf_search;
    But to permanently disable the cache requires custom code. I just posted this code modification if you are interested:

    Eliteoomph and Brogan like this.
  4. Eliteoomph

    Eliteoomph Member

    Perfect!!! It works!!!

Share This Page