UESPWiki:SearchLog
The UESPWiki – Your source for The Elder Scrolls since 1995
< UESPWiki
This is a custom extension written by Daveh for the UESPWiki to log all search queries and provide a basic interface to view the logged entries. Users with the patrol permission are able to view the search log from the Special:SearchLog location. Source code of the extension is available below.
Basic features include:
-
- Log all successful and unsuccessful Wiki searches.
- Record the number of text/title matches displayed.
- Records the time taken for the search.
- Search queries are logged by date as well as a cumulative summary to show how often a particular search phrase has been used.
Installation[edit]
Note that the extension is known to work in 1.14 and 1.19. Other versions may work but are not "officially" supported.
-
- Download the extension files and place in the extensions/SearchLog path in your MediaWiki installation.
- Create the necessary database tables from searchlog.sql:
mysql -u user -p wikidb < searchlog.sql
-
- Add the following line to your LocalSettings.php
require_once ( "$IP/extensions/SearchLog/SearchLog.php" );
-
- Access the log via the Special:SearchLog link in your wiki.
Notes[edit]
-
- The logged search time includes some page rendering and setup and is not solely the search database/index time. A more accurate time requires the editing of MediaWiki files (includes/specials/SpecialSearch.php in particular).
- This does slow down the search time a little bit as it requires two database writes for each search. Use caution if installing on a large wiki (used successfully on the UESP with +1 million page/views).
- The searchlog and searchlog_summary tables in the MediaWiki database will need to be cleared out occasionally as they will grow large and become slow to update. Currently this has to be done manually and the feature is not included in the extension.
- Depending on what search engine you use the title/text counts may not always be correct. For example with Lucene the title count is always 0.