DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:searchstats

This is an old revision of the document!


SearchStats Plugin

Compatible with DokuWiki

Anteater, Rincewind, Binky, Ponder Stibbons

plugin This plugin records the search words and displays stats in the admin section

Last updated on
2011-06-29
Provides
Helper, Admin, Action
Repository
Source
Conflicts with
docsearch

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Tagged with !broken, search, statistics

Download and Installation

Download and install the plugin using the Plugin Manager using the following URL or refer to Plugins on how to install plugins manually.

Requirements

PHP has to be configured with –enable-bcmath (http://www.php.net/manual/en/bc.installation.php). Most Webhosting Provider enable this option by default.

No special requirements.

Syntax and Usage

Nothing special to do for you. The plugin stores search keywords automatically and displays stats in the admin backend. The bar chart is displayed by using the Google Chart API.

Todo

I want to contact the guys from Cloud Plugin if they could use my data to display a nice Search Keyword Cloud.

I just contacted them and there will be an update for the Cloud Plugin and for my Searchstats Plugin :)

Update took place on both sides. Enjoy!

  • Check installation by using plugin manager.
  • Check conflict with the docsearch Plugin

Fix: PHP Warning: Missing argument 2 for ft_queryParser()

Updates

2010-09-03 10:45am: Added support for cloud and other plugins. If you want to use cloud and searchstats to add a nice “search cloud” please update!
2011-01-08 09:00am: Fixed the “plugin-manager issue”. Plugin may now be installed by using the plugin manager.
2011-06-29 10:00pm: Fixed the “PHP Warning: Missing argument 2 for ft_queryParser()” error in Rincewind Installations. Removed bc-math requirement.

Issues

There is a conflict with the docsearch Plugin. When docsearch AND searchstats are both installed your search keywords will get counted double. As you know that, you could halve the results of searchstats or wait for an update when I find a bugfix for that.

Fixed: Searchstats conflicts with wikistatistics. It's currently not recommended to install both in one dokuwiki installation. I will try finding a bugfix as soon as possible.

Bugs?

Is it just me or is every search counted twice? - Andy 03.09.2010

Actually that doesn't happen on my installation. Could you tell me a search term where this happens in your installation? Perhaps you could list the plugins you are using or mail them to me? - Imho 03.09.2010
Hi, thanks for the quick reply..it happens with all search terms. I also had a similar situation to the error below and i had to create the folder in data/index manually before I could use the plugin (my file/folder permissions are all ok, had no other problems so far). I´ll have a play around and let you know if I figure out what it is with the search 'doubling'.
Thanks. That would be great.
Seems to be a conflict with the docsearch plugin (a plugin I must admit that I have never used :-) ). I removed it and the stats are now correct. Whether this is a general conflict or just down to my installation, who knows… Cheers.
You are absolutely right. I installed docsearch and had the same 'doubling' effect. Docsearch Plugin indexes documents (pdf, …) and every time a user searches for keywords in the pages, docsearch performs a second search in the docsearch index. That's why we got a double counting. I will add docsearch to the conflict list and try to find a workaround in my plugin. Thank you so much for figuring this out. - Imho 06.09.2010
A possible Workaround is to check if $conf['datadir'] contains the word docsearch.
function _getSearchWords(&$event, $param) {
global $conf;

if(strpos($conf['datadir'],"docsearch") == false){
...


I get the same issue (all search reported twice), I switched back to the default template and disabled all other plugin but I still have the issue. - Matthieu 07.01.2011

update : a search is counted twice when the cache is empty, so every new search start at 2, then increment one by one. If I delete the cache, it's counted twice one more time. - Matthieu 08.01.2011

The searchstats statistics page fully load?! When I manually delete the index directory data/index/searchstats the page is loads ok – until I do the first search. I installed searchstat 2010-09-15 manually because of the above issue with the capital S. Btw. the cloud plugin lists the searches correctly. Any ideas? — dan 13.10.2010

Might be due to “PHP has to be configured with –enable-bcmath”, see above — dan 24.03.2011
Just for info: From today, -enable-bcmath isn't necessary any more — Imho 29.06.2011

—-

Looks like something has changed in the search mechanism in Rincewind. I get the following error in a clean install with only searchstats installed:

PHP Warning: Missing argument 2 for ft_queryParser(), 
called in F:\Dokuwiki-Test\lib\plugins\searchstats\action.php on line 46 
and defined in F:\Dokuwiki-Test\inc\fulltext.php on line 495

- Andy 10.05.2011

Indeed, I have the same bug here. The plugin still uses the older version of the function ft_queryParser(), which only needed 1 argument back then. Until the proper authorities fix this, here's the trick that worked for me. In lib/plugins/searchstats/action.php, change the following line :

$q = ft_queryParser($event→data['query']);

to :

$q = ft_queryParser(idx_get_indexer(), $event→data['query']);

That should do it.

- Sylvain Bigonneau 27/05/2011
I can confirm that this fix worked for me as well. I'm running the latest (Rincewind) release with the latest patches applied.
- Rick Farris 22/06/2011
Hi, thanks Sylvain for posting the fix here. I'm gonna provide a fixed version of searchstats in the next days.
- Imho 28.6.2011
Hi, I just updated the plugin with the fix.
- Imho 29.6.2011

—- On “Binky”, after clean install, entering the plugin's page in Admin area first time (ie.: there are NO search words registered yet) there are a lot PHP error messages appear till I use the search function at least once. Peter, 07/02/2014


Chinese font and other East Asian characters seem not be supported. In these language, space is not used to separate between words. So a word comprised of several characters will be divided into different queries. For example, searching for a Chinese word “维基” results in two queries “维” and “基”. – baifeng 7/29/2013

plugin/searchstats.1436497662.txt.gz · Last modified: 2015-07-10 05:07 by 46.237.211.171

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki