Announcement

Collapse
No announcement yet.

Anyone having issues with number of search results / blog / article posts...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Anyone having issues with number of search results / blog / article posts...

    I figured out that there is a hard coded number that equals 30 days in the search that sets how 'Relevant' the results are. This basically limits the search results, blogs and articles to only display results from the past 30 days.

    I put it in a ticket to make this something that can be defined:
    http://tracker.vbulletin.com/browse/VBF-441

    If you really want to change this, in search.php look for
    PHP Code:
    'searchdate' => (Category::registry('Search_All_0')->getRelevantPeriod() / (24 60 60)), 
    getRelevantPeriod is = 2592000 / 86400 = 30 days

    Change 24 * 60 * 60 to something less than 86400 seconds. I changed mine to 12 * 60 * 60 for 2 months
    Last edited by tpearl5; Fri 18th Nov '11, 1:26pm.

    Capture more registrations - Advanced Guest Posting & Registration
    Cell Phone Forums | Nikonites

  • #2
    Originally posted by tpearl5 View Post
    I figured out that there is a hard coded number that equals 30 days in the search that sets how 'Relevant' the results are. This basically limits the search results, blogs and articles to only display results from the past 30 days.


    I put it in a ticket to make this something that can be defined:
    http://tracker.vbulletin.com/browse/VBF-441


    If you really want to change this, in search.php look for
    PHP Code:
    'searchdate' => (Category::registry('Search_All_0')->getRelevantPeriod() / (24 60 60)), 

    getRelevantPeriod is = 2592000 / 86400 = 30 days


    Change 24 * 60 * 60 to something less than 86400 seconds. I changed mine to 12 * 60 * 60 for 2 months

    Hey tpearl!


    Nice investigative work! We do in fact limit search relevancy to 30 days by default. However, while your fix will work, there's a better way! (Your fix may not work in all cases, because the calculation you're altering is a conversion from seconds to days.)


    DISCLAIMER: THIS IS NOT OFFICIALLY SUPPORTED. EDIT YOUR CONFIG.PHP AT YOUR OWN RISK.


    Open up your config.php and find the lines which look like this:


    Code:
    $config['categories'] = array(
        
    "Newest_Threads" => array( "weight" =>  10.2, "cache_time" => 17, "relevant_period" => 30 * 24 * 60 * 60),
    "Popular_Threads" => array( "weight" =>  10.1, "cache_time" => 17, "relevant_period" => 30 * 24 * 60 * 60),
    ...
    "Newest_Articles" => array( "weight" =>  9.5, "cache_time" => 17, "relevant_period" => 30 * 24 * 60 * 60),
    "Popular_Articles" => array( "weight" =>  9.4, "cache_time" => 17, "relevant_period" => 30 * 24 * 60 * 60)
    
    );
    Insert a new line for the search category that looks like this:

    PHP Code:
    "Search_All" => array( "weight" =>  0.5"cache_time" => 25"relevant_period" => period_expression), 
    Where period_expression is php code which evaluates to an integer representing the number of seconds in the relevancy period. An example as above would be "30*24*60*60", (without the quotes) representing a thirty day relevancy period.

    Happy hacking!

    Comment


    • #3
      Thanks for the additional info. I was just trying to figure out why my blogs weren't displaying (there haven't been any in the past 30 days) and didn't realize there was a setting in the config for it.

      Capture more registrations - Advanced Guest Posting & Registration
      Cell Phone Forums | Nikonites

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X