In MediaWiki, is it possible to capture user search terms that don't return results?
That is, is there a way to log what people are searching for but are not getting any r开发者_如何转开发esults in order to tell me where I need to add/improve the documentation so they get a result?
There are various ways to do this. If you have access to the Apache server logs, the simplest approach may be to add a transparent image to [[MediaWiki:Search-nonefound]]
using wikisyntax ([[File:Transparent.gif]]
), then watch for requests for this image in your (combined, not common) Apache server logs.
You should see log entries that look something like the following, when a user executes a search with 0 results:
127.0.0.1 - - [10/Mar/2010:18:02:05 -0500] "GET /images/Transparent.gif HTTP/1.1" 304 - "http://127.0.0.1/w/index.php?title=Special%3ASearch&search=simpsons&go=Go" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10"
In this case, the failed search was for simpsons
.
There is no such feature for real yet, but you could use a search backend which supports something similar.
The original proposal to implement the feature might be https://phabricator.wikimedia.org/T8373 / https://phabricator.wikimedia.org/T9969.
精彩评论