Home > Fluid Dynamics Search Engine > Help > 1154

Displaying "Most Popular Searches"

Follow these steps to display the most popular searches:

  1. Install FDSE version 2.0.0.0058 or newer.

  2. Go to "Admin Page" => "General Settings" => "Use DBM Routines" and confirm that the setting is enabled (checked). It is enabled by default.

    The "Most Popular Searches" feature is implemented using DBM files. DBM files provide fast data lookup, but, unfortunately, they are not supported on all platforms. In a later step you will get to test whether DBM files work on your platform. If they do not, you will not be able to use the "Most Popular Searches" feature, and you will need to return to the General Settings and disable "Use DBM Routines".

  3. Go to "Admin Page" => "Usage Statistics" => "Logging: Display Most Popular".

    Set this setting to the number of top search strings that you would like to display. To optimize performance, use a fairly small value like 5 to 10.

  4. After changing the setting "Logging: Display Most Popular", go to "Admin Page" => "Usage Statistics" => "Delete Log Files" and delete the DBM files.

    You should clear the DBM file whenever you edit that setting.

  5. Next, go to your public search page and perform a bunch of searches. If you see an error message regarding problems updating the DBM log files, then you are on a platform that does not support DBM. You will not be able to use the "Most Popular Searches" feature, and you should return to the General Settings and disable "Use DBM Routines".

  6. Otherwise, if the searches appear to be running normally, then DBM logging is working properly. You can now customize your templates to display the most poular searches.

    The following template variables will be created when the "Logging: Display Most Popular" setting is greater than zero:

    %t_since% Date since the DBM file was started. The DBM file stores information about the popularity of search strings.
    %tu1% Search string, URL-encoded, popularity #1.
    %th1% Search string, HTML-encoded, popularity #1.
    %c1% Integer count of number of times this search string has been used since DMB file was started.
    %tu2% Search string, URL-encoded, popularity #2.
    %th2% Search string, HTML-encoded, popularity #2.
    %c2% Integer count of number of times this search string has been used since DMB file was started.

    There will be a total of n sets of variables %thn%, %tun%, %cn%, where n is the integer value of the "Logging: Display Most Popular" setting.

    Go to "Admin Page" => "User Interface" => "Advanced: Edit Templates" and select the template where you would like the most popular searches to appear. Enter some HTML that uses the variables provided.

    Here is a sample HTML block for displaying the most popular searches on the search tips page:

    <p>Most popular searches (since %t_since%):<br />
    <i>search-string</i> (count)<br />
    <a href="%search_url_ex%q=%tu1%">%th1%</a> (%c1%)<br />
    <a href="%search_url_ex%q=%tu2%">%th2%</a> (%c2%)<br />
    <a href="%search_url_ex%q=%tu3%">%th3%</a> (%c3%)<br />
    <a href="%search_url_ex%q=%tu4%">%th4%</a> (%c4%)<br />
    <a href="%search_url_ex%q=%tu5%">%th5%</a> (%c5%)</p>
  7. The resulting search tips page will look like this:

    Example modified output of search tips page


    "Displaying "Most Popular Searches""
    http://www.xav.com/scripts/search/help/1154.html