Tags:
create new tag
view all tags

Question

  • Is there a simple possibility to log all searches that has failed (failed means that no topic was found)?
  • I want to add the text of the search to a topic in order to create a list of "wanted topics".
  • Thanks for your help.

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: RedHat
Web server: Apache
Perl version: I think Perl 8
Client OS: MS Windows XP service pack 2
Web Browser: Internet Explorer 6
Categories: Search

-- KirstinWeber - 23 Apr 2007

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

Not sure I understand. Possibly WantedTopics?

-- PeterThoeny - 23 Apr 2007

WantedTopics is also a good idea. But I want to create another feature: If somebody searches for a word (for example "sun") but gets no hit at all I want to add the word "sun" automatically to a list. So this list contains all failed searches. After a while I can investigate these words and create new topics for the important ones. Using this solution I will get to know which topics are missing and perhaps if some topics are named wrong because the users search for another word but not for the name of the topic.

-- KirstinWeber - 24 Apr 2007

interesting idea - for which you'll need to write a twiki plugin - and it'll be a really interesting one, because i don't think there are plugin hooks to do what you need - not impossible, just harder.

-- SvenDowideit - 24 Apr 2007

I do not know how to write a plugin. Is it hard to do so (I know there is a documentation but I have not read it yet)? So I only want to know if I have to learn a lot before starting or if it is straight forward.

-- KirstinWeber - 25 Apr 2007

It depends. If you know how to program Perl it should be straight forward. Start in TWikiPlugins. If you are not a programmer it might be difficult to create a plugin.

-- PeterThoeny - 25 Apr 2007

I am a programmer but I do not know Perl ( but I want to lern it). Where can I find the search script? It is the right place to attach my logger, is it not?

-- KirstinWeber - 26 Apr 2007

Kirstin, the first step is to familiarise yourself with what can, and what cannot, be done in a plugin. I think to do what you want will require careful definition, and changes in the core code. For example, what constitutes a "word" in a search? Should you add words from regular expression searches? How can you search without having your search logged?

My approach to this would be to use registerTagHandler('SEARCH'... to declare a function that overrides the default %SEARCH function, do your analysis, and then call the core tag handler function to do the actual search.

-- CrawfordCurrie - 14 May 2007

Actually, the search term is recorded in the log. So you could examine the logs in a standalone script. Example log entries:

| 14 May 2007 - 18:16 | TWikiGuest | search | TWiki | learn Mozilla | 10.20.30.40 |
| 14 May 2007 - 18:40 | TWikiGuest | search | Support | z/os Mozilla | 10.20.30.40 |
| 14 May 2007 - 18:41 | TWikiGuest | search | Support | ebcidic Mozilla | 10.20.30.40 |
| 14 May 2007 - 18:41 | TWikiGuest | search | Support | os/390 Mozilla | 10.20.30.40 |
| 14 May 2007 - 19:14 | TWikiGuest | view | Support.TWikiForResearchers |  spider | 218.17.227.211 |

Unfortunately it contains also the browser agent (new in TWiki 4), so you'd need to filter that out. Here is a sample query that filters out all search terms from the log:

grep '\| search \|' log200705.txt | sed 's/ \| [0-9\.]* \|$//; s/.*\| //; s/\(.*\) .*/\1/'| sort | uniq

-- PeterThoeny - 15 May 2007

Thanks for your help. I will try it.

-- KirstinWeber - 16 May 2007

Change status to:
Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r10 - 2007-05-16 - KirstinWeber
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.