TITLE: Popular Queries for GSA
CREATOR: dave olsen, wvu web services
easily be embedded into your GSA templates
- Logs in and out of your GSA automatically
- Censors naughty words
- Emails daily reports of top search queries to whomever you want
- Tracks clicks on popular queries using Google Analytics
- Deletes generated reports to keep your GSA reporting interface clean
WVU is now including popular queries on our search page.
- Google Search Appliance (tested on 4.6.4)
- PHP 5 or greater
- PECL_HTTP (tested on 1.5.6 & 1.6.3)
To check if you have it installed already type the following at the command prompt:
If you have it already you’ll see the module ‘http’ listed. If you don’t see it type the following at the command prompt:
pear -d memory_limit=16M install pecl/pecl_http
You’ll then need to edit your php.ini file. Add the following to the extensions section of it:
Download ‘Popular Queries for GSA’
You can do this two ways. If you use Git you can type the following
at the command prompt in the directory* you want this installed:
git clone git://github.com/dmolsen/popular-queries-for-gsa.git
Alternatively you can also download it by clicking the green download
- - git will create a directly called popular-queries-for-gsa so no
need to duplicate it
First copy settings.default.inc.php to settings.inc.php. This way future
changes to the settings file won’t overwrite your defaults.
All settings (e.g. GSA username/password) for ‘Popular Queries for GSA’
are located in settings.inc.php. You can also enable or disable features
in that file.
Note #1: In the current release (v1.0) the “bad words” filter is not very
robust and should be edited.
Note #2: While ‘Popular Queries for GSA’ doesn’t need to be in a web-
accessible folder (and probably shouldn’t) the $path_to_include should
be to a web-accessible folder.
Set-up Cron Jobs
To automate generation of your popular queries include file edit your
crontab. If you need to use a different account to run the cron jobs
make sure that account has appropriate permissions to write to the
popular-queries-for-gsa log & cookie store folders.
Example cron jobs follow. The first job runs at 12.30am and the second
30 0 * * * php /path/to/generate_report.php
45 0 * * * php /path/to/export_and_build.php
Customizing Look & Feel of ‘Popular Queries for GSA’
Via settings.inc.php you can edit the general look and feel of your
popular queries list. The directions there should be fairly straight-
forward. By default ‘Popular Queries for GSA’ builds an unordered list.
Also, by default, each popular query link gets the class ‘recent_query’.
If you haven’t modified the XSLT for your GSA you may want to add the
following to the footer area. Note that if you do it will show up
on every page produced by your GSA. You also may want to make sure it’s
not a list.
1. Copy & paste the following code into your template:
</script><noscript>No popular queries from yesterday to show.</noscript>
2. Update the src address.