MTSearches

MTSearches in a container tag that will go through all the of the searches that have been made on your site.

Here's how I use it:

Recent Searches:<br />
<MTSearches lastn="8" unique="1">
<a href='<$MTCGIPath$><$MTSearchScript$>?search=<MTSearchValue>'>
<MTSearchValue></a><br />
</MTSearches>
<br />
Top Searches:<br />
<MTSearches lastn="10" rank="1">
<MTSearchRank>. <a href='<$MTCGIPath$><$MTSearchScript$>?search=<MTSearchValue>'>
<MTSearchValue></a> 
(<MTSearchTotal>)<br />
</MTSearches>

Download recentsearch.tar.gz or recentsearch.zip , unpack it, and place recentsearch.pl in your plugins directory.

MTSearches

  • container tag for the list of searches that are pulled from the log
  • arguments
    • days: to include searches from only the last n days (e.g. <MTSearches days="7">)
    • lastn: to include n searches in the list (e.g. <MTSearches lastn="5">), if no other arguments are giving, these are just the last n searches
    • unique: to include only the latest instance of a particular search (e.g. <MTSearches unique="1">)
    • rank: orders the searches by rank, the most common being the first (e.g. <MTSearches rank="1">), implies unique

MTSearchValue

  • the value of the current search

MTSearchDate

  • the date of the current search
  • takes one argument, format, used just like MTDate

MTSearchIP

  • the IP from which the search was requested

MTSearchTotal

  • the number of times this specific search has been made

MTSearchRank

  • the rank of the search overall, 1 being the most common

ChangeLog:

  • Version 0.61: Bugfix: Now it works in December
  • Version 0.60: Added days to MTSearches
  • Version 0.52: Added MTSearchTotal, MTSearchRank, and rank to MTSearches
  • Version 0.45: Added MTSearchIP and unique to MTSearches
  • Version 0.35: Fixed month+1 bug
  • Version 0.31: MTSearchDate now adjusts itself to the local timezone of the blog
  • Version 0.3: Added MTSearchDate
  • Version 0.2: Added lastn to MTSearches
  • Version 0.1: First version!

29 TrackBacks

MTSearches - for outputting searches from the now-built-in MTSearch tool and the activity log. Read More

Show off your searches from Live in the Delirious Cool on October 16, 2002 2:41 PM

When MT-search was what it was all about, Graham found a way to show what people were searching for on Read More

Things look a bit different, as I'm sure you've noticed. I finally switched to an all-CSS, three-column layout, with EXCELLENT Read More

David fixed the 'December bug'. [not able to search this weblog in December] He's fast. Read More

That Was Fun from Electric Venom on April 12, 2003 6:56 AM

Well, as mentioned, I've been tinkering around the Snakepit. It keeps me amused. Truth is, it was quite fun but a lot more work than I expected. I installed a rotating title bar, an idea that I picked up from Joni Electric, who always has the most cool... Read More

Things left behind. from Live in the Delirious Cool on August 20, 2003 2:35 PM

Oh, and no more WeatherPixie. Read More

MovableTypeの検索欄で入力された単語のランキングを表示するプラグイン MTSearches... Read More

Latest Updates from lingosphere daily on October 12, 2003 8:13 PM

Added Deltus' at scratchingtheitch.com's digital clock script, which I added over near the calendar. [via scriptygoddess] Also added David Raynes' "MTSearches" plugin to show the most recent searches within the site, plus a ranking of the top overall s... Read More

Latest Updates from lingosphere daily on October 12, 2003 8:15 PM

Added Deltus' at scratchingtheitch.com's digital clock script, which I added over near the calendar. [via scriptygoddess] Also added David Raynes' "MTSearches" plugin to show the most recent searches within the site, plus a ranking of the top overall s... Read More

MTSearches in a container tag that will go through all the of the searches that have been made on your site. ということで入れてみました。 とはいえ、まだプラグインのファイルをアップデートしていないようなのã... Read More

I received an e-mail asking help with displaying recent/top searches on a webpage. Since the e-mail did not include a reply address I will post mysolution to the above problem. I took the easy way out and use David Raynes'... Read More

MTSearches from www.ikepon.jp on February 2, 2004 9:29 AM

MTSearchesをインストールしました。 <div align="left" class="sidetitle"> 最近の検索 </div> <div align="left" class="side"> <MTSearches lastn="10" unique="1">  <a href='<$MTCGIPath$><$MTSearchScript$... Read More

MTSearches from www.ikepon.jp on February 2, 2004 9:31 AM

MTSearchesをインストールしました。 <div align="left" class="sidetitle"> 最近の検索 </div> <div align="left" class="side"> <MTSearches lastn="10" unique="1">  <a href='<$MTCGIPath$><$MTSearchScript$... Read More

MTSearches from www.ikepon.jp on February 2, 2004 9:33 AM

MTSearchesをインストールしました。 最近の検索を表示する方法です。 <div align="left" class="sidetitle">; 最近の検索; </div> <div align="left" class="side"> <MTSearches lastn="10" unique="1">  <... Read More

MTSearches from www.ikepon.jp on February 2, 2004 9:34 AM

MTSearchesをインストールしました。 最近の検索を表示する方法です。 <div align="left" class="sidetitle"> 最近の検索 </div> <div align="left" class="side"> <MTSearches lastn="10" unique="1">  <a... Read More

MTSearches from www.ikepon.jp on February 2, 2004 9:36 AM

MTSearchesをインストールしました。 最近の検索を表示する方法です。 <div align="left" class="sidetitle"> 最近の検索 </div> <div align="left" class="side"> <MTSearches lastn="10" unique="1">  <a... Read More

MTSearches from www.ikepon.jp on February 2, 2004 9:37 AM

MTSearchesをインストールしました。 最近の検索を表示する方法です。 <div align="left" class="sidetitle"> 最近の検索 </div> <div align="left" class="side"> <MTSearches lastn="10" unique="1">  <a ... Read More

MTSearches from www.ikepon.jp on February 2, 2004 9:39 AM

MTSearchesをインストールしました。 最近の検索を表示する方法です。 <div align="left" class="sidetitle"> 最近の検索 </div> <div align="left" class="side"> <MTSearches lastn="10" unique="1">  <a ... Read More

MTSearches from www.ikepon.jp on February 2, 2004 9:46 AM

MTSearchesをインストールしました。 %MOVABLETYPE_HOME%/pluginsディレクトリにrecentsearch.plを配置します。 最近の検索を表示する方法です。 <div align="left" class="sidetitle"> 最近の検索 </div> <... Read More

MTSearches from www.ikepon.jp on February 2, 2004 10:35 PM

MTSearchesをインストールしました。 %MOVABLETYPE_HOME%/pluginsディレクトリにrecentsearch.plを配置します。 最近の検索を表示する方法です。 <div align="left" class="sidetitle"> 最近の検索 </div> <... Read More

This plugin is designed to be used with MT-BlackList. The plugin gives you the ability easily see stats about what is being blocked by your blacklist, including the ability to summarize and rank blacklist entries. BlacklistStats is an adaptation of... Read More

MTSearchesプラグイン from Dasalog 〔多聞強識〕 on March 27, 2004 5:47 AM

David Raynes: MTSearches MTSearchesプラグインを導入してみました。「recentsearch.pl」をMTプラグインにアップロードし, Main Indexの任意の場所に <div class="sidetitle"> Recent Searches </div> <div clas... Read More

More Site Updates from The Media Drop on July 10, 2004 2:06 AM

Okay - a few more site updates tonight. I've temporarily disabled the visual PageRank because it's massively slowing the site down. I added Search Statistics to the stats section on the navbar. It utilizes David Raynes' MTSearches plugin. This should... Read More

MTSearches from 生活像啤酒一樣苦 像巧克力一樣的甜 on July 18, 2004 11:54 AM

MTSearches這個東西也很有意思。可以將你的MT里最近的Search Word以及順位排名都表現到主頁上。... Read More

MTSearches from www.ikepon.jp on August 19, 2004 9:21 PM

MovableTypeでMTSearchesを使用する方法を説明します。 Read More

MTSearches from 生活像啤酒一樣苦 像巧克力一樣的甜 on August 21, 2004 5:57 AM

MTSearches這個東西也很有意思。可以將你的MT里最近的Search Word以及順位排名都表現到主頁上。... Read More

·¢ÏÖmt´úÂë from ¡¾Ë®±ßÊ÷ľ±Ê¼Ç¡¿--Éú»î¡¢¼Ç¼¡¢½ÌÓý¡¢¸ÐÏë on January 9, 2005 11:06 PM

http://www.rayners.org/2002/12/mtsearches.php ¡¡¡¡ÔÚ×Ô¼ºµÄÍøÒ³ÉÏ¿ÉÒÔÏÔʾ×î½üµÄËÑË÷ÒÔ¼°×î¶àµÄËÑË÷³ÌÐò¡£²Î¿¼ÉÏÃæµÄÍøÖ·µÄ´úÂë,Õ³Ìùµ½×Ô¼ºµÄÍøÒ³Éϼ´¿É¡£À´×Ôhttp://www.cathome01.com/... Read More

Jag är barnsligt förtjust i sökningar! Dels de ord folk sökt på för att hamna på min sida och dels vad de gör för sökningar på själva sajten. På räknaren från Nedstat får man viss guidning vad gäller den första frågan, och via MT:s i... Read More

 現在MovableTypeにインストールしている(pluginsディ... Read More

29 Comments

Umm, the file link is broken...

When accessing it via the archives...

Whoops. :) It should work now.

Great! The addition of MTSearchDate is very useful. One question, though: my timestamp for each search is in GMT, and not my local timezone. Is this because the Search log is kept in GMT? If so, is your plugin designed to adjust the time according to the user's timezone?

thx

-phil

Yes, from what I can tell, the log stores its Dates in GMT. I'll see what I can do to convert them to the current blog's timezone.

Much appreciated.

I had posted to the MT support forum about this before. My time zone is OK, but the dates are still in November instead of October. I've installed version 0.31 and rebuilt.

All better. :) I have no idea what happened; I guess work has gotten me more distracted than I thought this week. I can't believe I actually missed that.

Aside from limiting the number of search strings displayed, how about an option to limit the strings displayed to only searches for a certain blogID?

Is this a bug in MT's search functionality, or just something to add to your plugin?

I love the plugin!

-Rick

As far as I'm aware, the search entry goes into the Log without any mention of which blog the search was performed on or from. Without changes to the log or mt-search, I don't think there is much I can do to implement a blogID limiting parameter. I'll think on it though.

Great you saved me some sleep! I had hacked Jay's script to do basically the same thing and was not looking forward to diving into MT to recreate the logging (I'm not real good with OO code). I have a couple of improvements to suggest if you’re the adventurous type:

Since it's almost already there add MTSearchIP tags
Some way to drop duplicate search terms like an alternate MTSearchValueUniq tag
A MTSearchToday tag that will only return searches done on the same date or within 24 hours of now.
A method of filtering unwanted (possibly naughty) terms by way of a config file.
A method for ranking searches i.e. top 10 terms over x amount of time

Just some thoughts if you’re like me you’re too busy to mess about for hours at a time. If I get around to it before you do I'll slap some code up here. But that will be another day.

Again thank you for putting this up!

Psyber
Just my 2 cents (actual worth may vary)

Great work on a great plug-on!

Quick quesiton, I host multiple blogs on the same installation of MT and would only like to show the search terms from my blog, is that possible?

Hmmm... 0.6 doesn't seem to like Decemeber much:
Month '12' out of range 0..11

Cool plugin when it works though.

Thanks for fixing the "December-bug"! It's working great now.

i noticed on your site that after you make a search and then reload your homepage, that search term is in your recent search list without the page rebuilding. how are you getting the list to reload without the template rebuilding if you wouldn't mind sharing a little bit more :) some sort of include?

thanks

That's actually thanks to a little hack I made to the MT::App::Search package. It rebuilds the indexes, but it forces the person performing the search to wait for the rebuilding to finish before the results are returned.

David, I've been using the plugin successfully since shortly after release and I noticed just now that the search data wasn't visible. When I went ahead and searched, my new search appeared, but the results appear to have "reset themselves"; I'm assuming they'll start over from zero. Fine with me, but I'm wondering if you might have a guess as to why?

Help!

Liked yr plugin: however, some 'helpful' joker wrote a script to test-pummel my server.

Without telling me he was going to do this, of course.

Now, I don't know where recent search results are actually stored to delete the 100 searches he did in 10 seconds.

LI'L IDEA: Can I cap the number of identical searches that get shown to stop this happening by a genuinely malicious user or even people who wanted to graffitize this function? ie searches more than say 20 are not displayed? This would have the added beneficial effect of stopping top searches reinforcing themselves and wearing a groove into yr site instead of opening up new crevices
found by visitors, which, as I understand it, is the cool thing about this plugin.

TIA

Patrick

were you ever able to fix the GMT timestamp issue?

were you ever able to fix the GMT timestamp issue?

sorry for the double. it errored out on me :(

David, did you document the MT::App::Search hack, the one that rebuilds the indexes before returning the search results? If so, I would like to implement that hack at my site. I probably could figure it out on my own, but if you already did the work... :)

Um...nevermind...I figured it out myself. Lot easier than I expected. Thanks anyway!

David,

I put in the hack successfully last night, but it looks like I don't get the page to "rebuild", which by reading the comments here, something was done to MT::App::Search. Can you give me some insights here, as now on my page nothing changes if you hit refresh after searching....

Thanks for your help!

Is it somehow possible to limit the the clickable part of the links? I currently have the problem that a very long searchstring without any spaces screws up the design. So I would like to limit the amount of characters of MTSearchValue displayed.

Is it somehow possible to limit the the clickable part of the links? I currently have the problem that a very long searchstring without any spaces screws up the design. So I would like to limit the amount of characters of MTSearchValue displayed.

Is it somehow possible to limit the the clickable part of the links? I currently have the problem that a very long searchstring without any spaces screws up the design. So I would like to limit the amount of characters of MTSearchValue displayed.

Is there a way to rebuilt the site automatically?
I read a lot about hacks and all that stuff but I didn't find anything about it on the net.

This script is great, and I've been using it on my site as a way to track tag usage.

Any way to separate out the results by blog id? What if you have more than one blog using mt-search?

Thanks.

Leave a comment

About Me

I am a software developer for Six Apart living outside of Baltimore, MD. I have written a number of plugins for Movable Type, including the award winning MultiBlog, which has (as of MT 4) been integrated into the base application....
More...

Recent Entries

  • Minimalist plugins are fun!

    Last night I whipped up one of the smallest plugins I’ve ever written. It is so small in fact that I was able to stuff...

  • Feedburner Widget on MT News

    Movable Type News A WordPress 2.5 Upgrade Guide: And of course there are lots of third-party plugins for the MT dashboard, to integrate statistics and...

  • AD&D Monster Stats for the Presidential Canditates

    Charles Stross (scifi author, D&D nerd, and former perl columnist) posted Politics as she is Played with 3d6: The recent death of Gary Gygax, who...

  • Feedburner Widget 0.3

    At this point, I am really tempted to drop the ‘Widget’ from the name of the plugin, since it is doing so much more...

  • Feedburner Widget 0.2

    So I finally got around to updating the FeedburnerWidget plugin for MT 4.1 (since I finally got around to upgrading my install to MT 4.1)....

Close