« Hide Inactive MT4 Menu Items with Dynamic Menus | Main | Visitor Stats for your MT4 Blogs »

Fast Search 2.1 - Support for MT4

Fast Search is a PHP plugin for Movable Type. This means that Fast Search uses Movable Type's dynamic PHP-based publishing system to display search results. However, you can continue to use static publishing for all of your indexes and archives. Fast Search is fast in part because it uses mySQL fulltext indexing -- basically this means that a search index will be created for the entries in your database, making searches much faster. Like the built-in search, Fast Search logs searches to the Movable Type Activity log.

New Features in Version 2.1

Fast Search v2.1 provides support for Movable Type 4.0 (MT4). Note that version 2.1 will not work with versions prior to MT4 -- if you are not yet running MT4, then you can download version 2.07 below, which works with MT 3.2 and MT 3.3x. Fast Search 2.1 contains no new features, it provides the same features for MT4.

Tag Searches with Fast Search

Fast Search supports tag search. A tag search will display a list of all entries with a specific tag. Of course, tag searches have the same pagination features as regular searches, enabling you to browse multiple pages of tag search results. Tag search results are always sorted with the most recent entries listed first. Tag searches can done on a single blog (default), or across multiple blogs.

Tag Search Links. If you are using tags, you are probably displaying a list of tags with each entry. Each of those tags are linked to a search results page that displays all the entries with that tag. Since those links point to the built-in mt-search.cgi script -- Fast Search includes a new version of the <MTTagSearchLink> tag that points to the Fast Search script. This happens automatically, you don't have to edit your templates -- just enable Fast Search, install the Fast Search template, then rebuild your pages -- the tag links will be automatically updated.

Clean Tag Search URLs

You can use nice looking tag search URLs such as:

http://mt-hacks.com/tag/spam
http://mt-hacks.com/tag/comments

This feature requires editing your .htaccess file and a minor edit to the Dynamic Bootstrapping template. This feature is only available to those who purchase a license or for personal users for $33. More info on getting clean tag URLs below.

Better Relevancy

By tweaking the fulltext queries, I have managed to improve the relevancy ranking significantly. To test this out, you should do a few searches (in fulltext mode) before you upgrade to Fast Search 2.0/2.1 -- note the results and their relevancy -- then upgrade and do the same searches. You should see much more relevant results at the top of the search results. Please post your feedback on this by replying to this entry.

Search all Blogs Easier

In the previous versions of Fast Search, it was possible to search across all blogs on a system, but you had to specify each of them separated by commas. This is fine if you have a few blogs, but what if you have 50? 100? 500? Version 2.0 makes this easier by allowing the special "all" keyword to indicate that you want to search all blogs (example <MTSearchResults blogs="all"> or in the URL/form: ?query=books&blogs=all). A time-saver for large MT installations and blog networks.

Include PHP in your Search Results Template

This not a new feature, but it deserves highlighting. Many sites use PHP on most of their pages for various reasons (for example, to include content such as headers/footer and advertising blocks). The problem is that you can't use PHP on the "built-in" search results pages, because they are dislayed by a (Perl) CGI script. This can make it challenging to maintain your site in a consistent manner. You can avoid such problem with Fast Search -- since it is powered by PHP, you can include blocks of PHP code in the search results template. (Note: there is a small requirement that you need to use <?php to start each block, using simply <? won't work.)

What Search Method is Best?

For most cases, "Fulltext" will be the fastest search method. This is the same method used in version 1.0. There are some cases in which you might two options:

  • Non-Fulltext. Technically speaking this method used a LIKE %query% syntax. If you don't know what that means, don't worry about, just read on.
  • Fallback. The Fallback method is a combination method. FastSearch will first try a fulltext search, and if that returns no results, then it will try a Non-Fulltext search.

Non-Fulltext and Fallback are capable of some types of searches that you can't do with mySQL. You might want to use Non-Fulltext or Fallback to:

  1. search multi-byte languages such as Arabic and Japanese.
  2. search words shorter than 3 characters (such as "MTV")
  3. search partial words
  4. search a mySQL database that does not support Fulltext searching

Template Tags

Version 2.0 / 2.1 of FastSearch is designed to easily replace the existing search functionality in Movable Type, but with added features. For example, if you are currently using customized search templates, you can use them with Fast Search, with very few changes in most cases. Many Fast Search template tags have the same names as their CGI counterparts:

  • <MTSearchString> - The search string (query) being searched.
  • <MTSearchResults> - A container tag that displays search results. Arguments include (all are optional):
    • lastn - restricts the search to n results. (example <MTSearchResults lastn="10"> ) The lastn argument, like all arguments for MTSearchResults, can also be specified in the URL (...&lastn=10) or POSTed from a search form)
    • offset - used in coordination with lastn, starts M entries from the start of the list. (example <MTSearchResults lastn="10" offset="10"> will display results 11-20)
    • order - must be either 'date' or 'relevance', the default is 'relevance'. (example $lt;MTSearchResults order="date"> will provide similar results as the CGI search)
    • category - must be a valid category ID for the current blog - restricts the search results to entries from this category.
    • google_highlight - if specified, search words will be highlighted. (example <MTSearchResults google_highlight="1"> )
    • query - the search string (text) to be searched. In normal use, you would NOT include this argument as part of the <MTSearchResults> tag, rather, it would be specified as a URL paramter (example ...query=search+phrase) or POSTed from a search form.
    • new - tag - the tag to be searched. In normal use, you would NOT include this argument as part of the <MTSearchResults> tag, rather, it would be include as a URL parameter (example ...tag=books) as part of a Tag Search Link.
    • blogs - a comma-separated list of blog_ids if you want to search more than one blog. This argument is optional, if excluded, only the current blog will be searched. Example usage: <MTSearchResults blogs="1,3,8">new - Set blogs equal to "all" to search every blog on the sytem.
  • <MTBlogResultHeader> - this is container tag that displays content before the search results.
  • <MTBlogResultFooter> - this is container tag that displays content below the search results.
  • <MTNoSearchResults> - A container tag that displays its content only if zero results are found. Note that this tag must be used after a <MTSearchResults> container.
  • <MTNoSearch> - A container conditional tag that displays its content only if no search phrase was specified. new - Now supports the use of <MTElse> inside this container.
  • <MTSearchCount> - The number of search results displayed on the current search results page. This tag should be used with a <MTBlogResultHeader> or <MTBlogResultFooter> container.
  • <MTSearchFirst> - The number of the first search result on the current page. This tag should be used with a <MTBlogResultHeader> or <MTBlogResultFooter>container.
  • <MTSearchLast> - The number of the last search result on the current page. This tag should be used with a <MTBlogResultHeader> or <MTBlogResultFooter>container.
  • <MTSearchIfNextPage> - A conditional tag that displays its content if there is a subsequent page of search results. This tag should be used with a <MTBlogResultHeader> or <MTBlogResultFooter>container.
  • <MTSearchNextPageLink> - Output a URL to the next page of search results. This tag should be used within <MTSearchIfNextPage> tags.
  • new - <MTSearchIfPreviousPage> - A conditional tag that displays its content if there is a previous page of search results. This tag should be used with a <MTBlogResultHeader> or <MTBlogResultFooter>container.
  • new - <MTSearchPreviousPageLink> - Output a URL to the previous page of search results. This tag should be used within <MTSearchIfNextPage> tags.
  • <MTSearchTotalResults> - The total number of matching results in the database.
  • <MTSearchPages> - A container tag that can display links to multiple pages of search results. Optional arguments include:
    • max - the maximum number of page links to display on each page. Example: <MTSearchPages max="20">
    • glue - a text string that seperates each page. For example, if you wanted to display 1 - 2 - 3 - 4, you could use <MTSearchPages glue=" - ">
  • <MTSearchPageNumber> - Displays the page number of each search results page. This must be used within a <MTSearchPages> container.
  • <MTSearchPageLink> - Displays the URL to each search results page. This must be used within a <MTSearchPages> container.
  • <MTSearchIfCurrentPage> - A conditional tag that only displays its contents if the page number is the same as the current page - you would normally use this is you wanted to highlight the current page in the list of page numbers, etc. This must be used within a <MTSearchPages> container.
  • new - <MTIfStraightSearch> - A conditional tag that only displays its contents if the search is a normal search and not a tag search.
  • new - <MTIfTagSearch> - A conditional tag that only displays its contents if the search is a tag search and not a normal search.
  • new - <MTFastSearchScript> - This tag displays the filename of your Fast Search script. You can use this in your search forms as shown below. Note: for this tag to work, you should not rename your Fast Search template -- it should laways be named "Fast Search". This tag works in both static and dynamic templates.
  • replacement - <MTTagSearchLink> - This tag overrides the built-in tag of the same name (this automatic, not need to edit templates or anything). The new version of the tag is "smart" -- if Fast Search is enabled for a blog, it will link to the tag search results using the Fast Search script -- if not, it will use the built-in search script. This tag has the following optional argument:
    • tag_dir - Use this argument to specify a "directory" name for your tag search URLs. Note: This feature is only available to personal users who make a donation OR those who buy a commercial license.

Note: the new default Fast Search template includes pre-formatted template code that displays Google-style search results page links.

As you may have noticed, some of the tags above are identical to the ones used for the existing CGI-based search results. This is by design, so you will easily be able to cut-and-paste your existing search template code into the Fast Search template, though some minor modifications may be required.

Working Examples:

Here are some working examples you can try. Feel free to try additional search queries and note the speed that searches are performed.

  • Tag search results on MT Hacks. Example tags: spam cms.
  • Mars Rover Blog has over 5,000 entries. Example search: "water on mars". Note that this example shows the default FastSearch template, which is very similar to the default search results template in MT 3.2.
  • Seinfeld Blog has over 8,000 entries, 180 of which consist of the episode descriptions and scripts of all 180 episodes. Fast Search powers the Seinfeld Script Search, which is restricted to a single category containing the episodes. Example search: 'bubble boy'

Requirements:

  • Movable Type 3.2 or 3.3 (Fast Search v2.07)
  • Movable Type 4.0 (Fast Search v2.1)
  • mySQL

Instructions

  1. Download the plugin and expand the zip file.
  2. Upload the contents of the 'plugins' folder to the 'plugins' directory of your MT installation (usually something like /cgi-bin/mt/plugins).
  3. Version 2.07 for MT3.2 and 3.3 only: Upload the contents of the 'php' folder to the 'php' directory (usually something like /cgi-bin/mt/php)
  4. Login to the MT admin interface. If you already logged in, choose 'Main Menu'
  5. If your are running MT 3.3 or 4.0, you should be redirected to an 'Upgrade' screen at this point. The Fast Search upgrade process will update your database to add a fulltext index to the table in your database where entries are stored. Note that this may take some time if you have many entries, and this will add to the overall size of your database. Note: If you are installing FastSearch for the first time and you don not see an upgrade sceen, then you should follow Step 6: go the the plugin settings and click the link to create the Fast Search index.
  6. If you are running MT 3.2, you will not see the upgrade screen (as it is a 3.3 feature), so you need to create the index by browsing to the 'Plugin Settings' of a blog where you want to use Fast Search. Choose the 'Plugins' then find 'Fast Search' and choose 'Settings'. Now click the link in bold that says "Click here to create or rebuild the FastSearch fulltext index". Again, this may take some time, please be patient. After the index has been created, hit the Back button.
  7. Now browse to the 'Publishing' settings for the blog, and scroll down to the Setting called "Dynamic Publishing". If the first option, "Build all templates statically", is selected, you should change this setting to "Set each template's Build Options separately" and click "Save Changes" at the bottom of the screen. Otherwise, you don't need to make any changes here.(Note that change this setting will create an .htaccess file in the root path of the blog. Normally you won't notice this and everything will work fine, but if you have an existing.htacces file, you may want to take a look at it to make sure everything looks okay)
  8. If you just changed your Dynamic Publishing settings in the previous step, you should now rebuild all files for this blog by choosing "Rebuild Site" from the left menu, then "Rebuild all Files". Version 2.07 for MT3.2 and 3.3 only: You should also ensure that you have a "Dynamic Site Bootstrapper" (mtview.php) index template and make sure that it gets built, if it hasn't been built previously.
  9. Now return to the Fast Search settings and check the box to enable Fast Search. You may also want to adjust the settings for Maximum Search Results and logging, then click "Save Changes".
  10. Open the Fast Search settings once again and choose "Click here to install the default Fast Search Template." The template will be created and then displayed. This is an dynamic Index template (which can be customized) used to display the search results. (If desired you can also skip this step and create the index template manually, use the template tags as desired, or by cutting and pasting your exisiting search template code)
  11. Upgrading Fast Search

    Follow steps 1 to 3 above, then adjust your Fast Search plugin settings and search template, if desired. If you using Tag Search, you probably want to update your Fast Search template. One way to do this is to rename or delete your existing template, then reinstall the new default template from the plugin settings area.

    After Upgrading to MT4

    After upgrading to MT4 and installing Fast Search 2.1, there is one more thing you may need to do. In MT4, the 'php' folder resides inside /plugins/FastSearch/. But if you installed previous version of Fast Search, you had to upload the 'php' files to /php/plugins directory. Now that you have upgraded to MT4 and Fast Search 2.1, you need to delete those files from /php/plugins.

The Search Form

If you already have search forms on your blog pages, you need to update them to point to the new Fast Search template. For each template that contains a search form, look for the following (or similar):

<form method="post" action="<$MTCGIPath$><$MTSearchScript$>"

...and change it to:

<form method="post" action="<$MTBlogURL><$MTFastSearchScript$>"

...save the template and repeat this step for every template that has a search form.

If you want to insert a new search form on your site, or completely replace existing forms, you can use the following:

<form method="get" action="<$MTBlogURL$><$MTFastSearchScript$>">
    <label for="query" accesskey="4">Search this blog:</label><br />
    <input id="query" name="query" size="20" />
    <input type="submit" value="Search" />
</form>

Or better yet, install the new Fast Search Widget from the plugin settings area, and use WidgetManager to add the widget to your sidebar (you should also remove the existing search widget).

Of course you can also add optional fields to the form such as:

<input type="hidden" name="order" value="date" />

....to sort the results by date, or....

<input type="hidden" name="category" value="5" />

...to restrict the search to category_id = 5.

Once you have the search form(s) on you site, rebuild those pages and start searching. You should notice significant speed and resource improvement, especially on blogs with many entries.

Fast Search Settings

Fast Search settings are on a "per blog" basis. To access the settings, browse to the blog you want to use, then choose "Settings", then "Plugins". Look for Fast Search in the list and click the "Show Settings" button.

Get Fast Search

After purchasing a license below, you will be taken directly to a download page with a link to download Fast Search Pro, which includes the "clean tag URLs" feature described above. See the text file included with the download for instructions)

Commercial use - (up to 5 blogs) - $97.00

Fast Search 2.1 for MT4:

Fast Search 2.07 for MT3.2 and 3.3:


Blog Network License - (more than 5 blogs) - $249.00

Fast Search 2.1 for MT4:

Fast Search 2.07 for MT3.2 and 3.3:


Non-commercial use - FREE ( although you must include a

Movable Type search results powered by 
<a href="http://mt-hacks.com/fastsearch.html">Fast Search</a>
link on your search results pages.

If you would like to use the "clean tag URLs" feature described above for non-commercial use, the price is $33:

Fast Search 2.1 for MT4:

Fast Search 2.07 for MT3.2 and 3.3:

Download Now

Membership required, please sign-in or register:

As always, suggestions and feedback are appreciated. Please reply to this entry.

Note: FastSearch v2.0/2.1 is a suitable replacement for most implementations of the built-in search function in Movable Type. However, there are a few features that Fast Search v2.0/2.1 does not include. Fast Search v2.0/2.1 does not support comment searches, regexp search, case-senstive search, the use of AND and OR operators, and Edit Entry Links). Some of these features may be supported in future versions -- please let me know what features you would like to see.

Rate this entry:

  • Currently 4.3/5
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 4.3/5 (12 votes cast). Powered by the Ajax Rating plugin.

TrackBack

TrackBack URL for this entry:

Listed below are links to weblogs that reference Fast Search 2.1 - Support for MT4:

» FastSearchに見る、MT4のタグチェック機能の裏側 from WolaWola
FastSearch2.1をMT4にインストールしたら、「そんなタグは無いよ」という警告が、テンプレート画面で発生した。これはきっと、どちらかの見落としなのだろう。チェック時に認識していないだけで、プラグインとしては正しく動作する。 [Read More]

» Holy Moly! Graphical visitor stats for your blog. from MovableType.org - Home for the MT Community
Check out the latest plugin from the community: real time visitor statistics for your Movable Type 4.0 dashboard. Mark Carey, the developer of the plugin and the guy behind the very popular site MT Hacks has been busy building a... [Read More]

» Swoosh! from WIST
I've installed Fast Search on this blog and -- yow! Searches that used to take take 15, 30, 60 seconds with the out-of-the-box search capabilities all come back in just 2 or 3. It's fantastic. There are a few limitations... [Read More]

» Plugins for MT4 from Movable Type
Немного времени прошло с момента выхода MT4, а многие плагины уже обновились. Кроме того, появились новые интересные плагины. Вот некоторые из обновлённых или новых: Дэвид Рэйнес представил два плагина, находящиеся сейчас в альфа версии: FeedburnerWidg... [Read More]

» The Slow Death of Feedback from Bow. James Bow.
The eagle-eyed among you may have noticed that the websites on my host, including this one, Political Staples and Transit Toronto have had their internal search engines replaced by internal searches provided by Google. After testing Google’s abi... [Read More]

» FastSearch! from ***Dave Does the Blog
I loaded up the FastSearch plug-in for MT on Friday for my WIST blog, and today expanded it over to this blog.  If you look in the sidebar, you'll see... [Read More]

» Change Log from Culture Snob
This page is the place where I'll post information about structure and feature changes at Culture Snob. In some cases, I'll also provide resources indicating how I did things. If you're having trouble with a particular feature, please report the... [Read More]

» The New and Improved berbs.us from berbs.us
Welcome to the new berbs.us. The migration took just a little longer than I was hoping due to some issues I had in moving all of my content over to the improved Movable Type 4 templating system. I need to... [Read More]

» Change Log from Culture Snob
This page is the place where I'll post information about structure and feature changes at Culture Snob. In some cases, I'll also provide resources indicating how I did things. If you're having trouble with a particular feature, please report the... [Read More]

» グローバルナビのテンプレ from WolaWola
もうじき、mt.Vicuna2.0のリリースなのだが、アイデア出したグローバルナビ部分は、MT本体のバグで採用見送りになってしまった。という訳で、こっちで取り上げてみようと思うのだ。 [Read More]

» پلاگین Fast Search from مووبل تایپ
جستجو در بلاگ یا سایت, جزو یکی از بهترین امکاناتی است که می توان در اختیار بازدید کنندگان قرار داد, اهمیت این موضوع زمانی آشکار میشود که حجم مطالب و صفحات شما بسیار بالا باشد و این سیر صعودی به... [Read More]

» Fast Search from The Hardware is Not Enough

My experiences with FastSearch, a Movable Type plug-in that improves the built-in search function.

[Read More]

» Thanks to Mark Carey from Solomonia
I just wanted to put in a plug for Movable Type expert Mark Carey of MT-Hacks.com for his help in sorting a couple of issues here on the back end of the blog. Movable Type is a nice blogging platform,... [Read More]

» Great Googley-Moogley! from WIST
I've found the FastSearch add-in for MT to be pretty handy -- quick, and eminently configurable to look like any other page here. But it does have some limitations, most especially in not being able to search by author. So... [Read More]

» Installing Movable Type 4 from ***Dave Does the Blog
I'm going to use this post to keep track of my MT4 installation.  The good folks at Hosting Matters (who are probably sick and tired of my site sucking... [Read More]

» how to sell a home fast from how to sell a home fast
I do not doubt that a low U.S. federal-funds rate in response to the dot-com crash [Read More]

Comments (42)

LaRosa [TypeKey Profile Page]:

Thanks for taking the time to update this plugin for MT4 :) works like a charm!

lj.

doopoo [TypeKey Profile Page]:

I am generating an xhtml page with FastSearch 2.1 for MT4.
However there are 7 blank lines in the published xhtml before the xml declaration.
This page is not well formed and will be rejected by any XML parser.
Any ideas How to remove these blank lines?

doopoo, this seems to be related to MT dynamic publishing system, and not specific to this plugin. I have never noticed those blank lines before. I wonder if it has some to do with the Bootstrapper template that has about 7 lines of PHP code -- maybe MT is counting the line-breaks in that template and rendering those before displaying the template output...

Does FastSearch include index templates in its search? If not, is there a way to do that?

David, what do you mean by "include index templates"? Fast Search searches Movable Type "Entries" in the database. It is not intended to be a complete "site search" solution.

David McCreath:

That answers my question. Thanks, Mark.

dm [TypeKey Profile Page]:

Mark, not sure if this is a bug that's fixed, but figured I'd let you know about it:

http://life.firelace.com/fastsearch.php?IncludeBlogs=1&search=http%3A%2F%2Flife.firelace.com

If you search for a URL with http:// then you get a preg_replace(): Unknown modifier: '/' error for FastSearch 2.07. I'm assuming that the new one for MT4 also has this error.

Carlo [TypeKey Profile Page]:

I installed MTFastSearch and once I try to install the dynamic index template I get these errors:

Your template changes have been saved. One or more errors were found in this template.

* at line 5 is unrecognized.
* at line 8 is unrecognized.
* at line 11 is unrecognized.
* at line 14 is unrecognized.
* at line 49 is unrecognized.
* at line 52 is unrecognized.
* at line 57 is unrecognized.
* at line 63 is unrecognized.
* at line 70 is unrecognized.
* at line 71 is unrecognized.
* at line 72 is unrecognized.
* at line 573 is unrecognized.
* at line 587 is unrecognized.

I'm pretty sure I followed the installation instructions correctly. I'm using MT 4.01 beta 2

Carlo:

For some reason the tags don't show up. The * are in place of the tags it says aren't recognized. This is wierd cuase the search.. it actually works even though it gives me that warning!

Carlo,

This is just a warning, not an error. Fast Search will continue to work. You can safely ignore these warnings -- they are caused by a limitation in MT4.

dm, thank for reporting that one. Fixed in development, to be released soon.

Carlo [TypeKey Profile Page]:

I've been surfing through the web and I found something I think could be a usefull feature for fast search. It would be really usefull if you could output a list of the top searches just like CNN has on the sidebars. They have top stories according to view, e-mailed and SEARCHED. I think that would be amazing.

Hi Mark,

I've got the same problem as Carlo, but my template isn't works, the MT4 saves it but it didn't build an archive template in my server, and the scripts doesn't work. I think i follow instructions correctly too, and I reinstalled plugin a couple of times.

Thanks!

In trying to customize the FastSearch results template, I'm getting the following error when in using my "entry summary" template module:

Invalid argument supplied for foreach()

It will display one search result, but nothing else before the error.

Any ideas what might be causing this?

Okay, I figured out the above issue. The dynamic template was having difficulty with nonstandard template tags, such as those generated by Custom Fields and PerlScript. So is there any way to avoid conflicts with those tags outside of removing them from the template?

A couple other questions:

1) The search results cover not only entries but pages. Is there any way to control whether it does or doesn't include pages?

2) I've noticed that FastSearch doesn't return results for strings of less than four letters. Intentional? Any way around it?

3) If I do a FastSearch on my site for "jerk" and "jerking," I get two very different sets of results. I would have anticipated that the results for "jerking" would have also shown up if one searches for "jerk," but they don't. There's no crossover. It would appear the plugin is searching for the strings as whole words, and not as parts of words. It would be great to be able to control that behavior.

Good questions, Culture Snob.

First, as you discovered, Fast Search, being a dynamic template, won't be able to render template tags from plugins that do not include PHP version of those tags. I can't speak for the 2 plugins you mentioned, but that seems to be the case here. One way to avoid this problem is to wrap that other plugin code in an MTIfStatic container tag. The contents of this container will only be processed if the page is being built using static publishing, and skipped if dynamic (like Fast Search).

1) As you noted, Fast Search searches both pages and entries. That said, an upcoming version of Fast Search will likely include some options to search either "only entries", "only pages", or both. Currently, it will always search both.

2) The default setting for mySQL Fulltext searching is to exclude words of less than 4 characters from the index. There are 2 ways around this: 1. If yoy have access to the mySQL config, you can change the setting. Be sure to rebuild your fulltext index (via Fast Search settings) after doing this. OR 2. You can use the "non fulltext" search mode, which does not have this limitation.

3) This is the way mySQL fulltext searching works. Again, if you use the "non fulltext" search mode, it will return partial word results. While technically slower than fulltext mode, most sites won't notice a difference (either mode is way faster than the built-in search).

Mark: Thanks! Very helpful.

Mark: Does the relevance order work with the non-full-text option? I'm getting the same result order with "relevance" and "date"; they're both sorted by date.

The "relevance" option only works with fulltext.

Johnnie [TypeKey Profile Page]:

Like Sergio (26 Sept) I've installed the plugin a couple of times to make sure, and I'm not getting the template built. When I click on the search I'm getting:

The requested URL /contents/other/fastsearch was not found on this server.

Not a lot to go on I know, but I've followed the instructions to the letter and still no dice.

BTW, are any of the boxes that appear when one changes the publishing method in MT4 required to be ticked?

Johnnie, those boxes don't need to be checked.

It sounds like you .htaccess file was not created, or is not working. When you enable MT's dynamic publishing, it will create .htaccess file in your blog directory. This file contains rewrite directives that are necessary for dynamic publishing to work. Sometimes MT does not have permissions to create this file, and other times the Apache config settings disallow the use of .htaccess files. The first step is to check to see if the file has been created, login via FTP or file manager and look for a file called .htaccess (Note: some FTP programs will hide files beginning with a '.', so make sure you are seeing all files. if the file is there, then it is most likely that a change needs to be made to the Apache config. Tell your web host that you want to use an .htaccess file in one of your directories, but it is not working.

I'm running into a problem on the Fast Search results page. I've got a combination of blog entries and pages spread across several blogs in my installation. These seem to be showing up in the results as expected, but when you go to click on the hyperlinked title of a page that shows up in the results, it appears the a href is blank.

I'm assuming the problem is that the default search result template doesn't try to distinguish between entries and pages, though the former has an EntryPermalink, while the latter has a PagePermalink.

It seems there's a need to conditionally see of a given result is an entry or a page so that the correct permalink can be used.

Do you know of anyway to do this right now?

Thanks,

Jason

Hi Mark, I got everything installed and it looked like it what was working fine except I kept getting a 404. I'm running MT 4 and was already running dynamic publishing on my blog, so I can only assume it has something to do with the htaccess file. Does Fastsearch add anything to htaccess? If so can I add this by hand? If not, any idea why this would happen?

Noah, Fast doesn't modify the .htaccess file.

Are sure that dynamic publishing is working for other index templates? To test, create an index template set it to dynamic. Does it work? When I try to go to a non existant page, such as this one -- I see a not found page that seem to be generated by the web server. When dynamic publishing is work, MT displays it own not found error, which usually looks like this one.

Another reason I ask is because I have seen some strange things with MT4 dynamic publishing, especially when you are publishing archives to a different directory than the "site root", as you seem to be doing on your site. Via FTP or file manager, look at the root directory. Do you seen both an mtview.php and .htaccess? Open them up and make sure they look okay. Now do the same in /archives/ -- did MT4 place an .htaccess or mtview.php file in there? If so, what do they look like?

Hey Mark, first off, thanks so much for the response and help. Dynamic publishing is working for other index templates. (Tested it with my about page, which I've since turned off dynamic.)

There is not mtview or .htaccess in /archives/ and the files in my root folder look fine to me (though I've added a bit to my .htaccess . . . but that shouldn't be the problem, since it seems to work fine for other files . . . right?) As for mtview.php, looks fine to me, though I found it a bit odd it was making a call to mt.cfg:

include('/path/to/mt/php/mt.php');
$mt = new MT(2, '/path/to/mt/mt.cfg');
$mt->view();

Any thoughts? Thanks again.

Hi Noah,

The mtview.php does need to make call to your config file -- but the question is, is that the correct config file. While MT4 may still support the mt.cfg filename, most MT4 (and MT3.3x) site use mt-config.cgi. This make me wonder whether the mtview.php is an old one, left over from an older version. You could try renaming this file, then go to the Pubishing settings for the blog, then hit save. This should trigger the creation of a new mtview.php. While you are at it, delete or rename the .htaccess file too, and let MT create both of the files when by saving the publishing settings.

If that doesn't help and the mt.cfg is the correct config file, the problem would seem to be with the .htaccess. What are the contents of it?

First off, thanks again and sorry for being bothersome. So I replaced .htaccess and mtview.php and we seem to be getting somewhere. Now when the I go to the page I get a smarty error: http://www.noahbrier.com/fastsearch

Any ideas? I definitely have it on dynamic publishing and there are no static files . . .

Noah, that smarty error suggests that smarty can't find the block.mtsearchresults.php file, which should reside in:

/path/to/mt/plugins/FastSearch/php/

Can you check that directory? There should be a bunch of other similarly named php files in there, one for each template tag.

Got it. Thanks so much Mark. I had the folder structure wrong, rather than placing /php and /tmpl into /Fastsearch, I had them sitting in the /plugins directory.

Thanks so much Mark, I really appreciate it.

whizkiddo [TypeKey Profile Page]:

Hi ,

Just downloaded FastsearchMT4.zip , when I unzip it a FastsearchMT4 folder gets created inside of which are 2 folder (php and tmpl) and one fastsearch.pl file

since there is no 'plugins' folder as mentioned in the installation guide, where do i upload each of these? shall i create a Fastsearch folder (any exact name required?) in my plugins folder (on server)? Thanks and let me know wat m i missing on the install guide.

whizkiddo [TypeKey Profile Page]:

ok just uploaded the unzipped fastsearch folder into plugins and it worked. thanks anyways! plz rename the folder to plugins or in the instructions, just to avoid the confusion.

Hi,

Ok I tried everything that I could think of but it still wont work , the error that I get is

Page Not Found
Smarty error: [in mt:98 line 8]: syntax error: unrecognized tag 'MTSearchString' (Smarty_Compiler.class.php, line 580)

I have tried renaming the uploaded folder to Fastsearch , tried rebuilding all files. Whats wrong ?

running mt4 , dynamic templates working , i am sure there is some confusion with regards to the installation. but it worked fine, asked me to upgrade the DB n all , so i figured it would work. Plz Help!

wardbh [TypeKey Profile Page]:

Hello,

Everything is working fine, search results are displaying templates are working etc, but at the bottom of the page, the following error is displaying...

Fatal error: Cannot redeclare class mt in /mnt/gs01/herd02/13075/domains/blogsbyfans.com/cgi-bin/blog-mt/php/mt.php on line 16

Here's an example. Any ideas?

http://www.depressedfan.com/fastsearch?tag=Mitchell%20Report&IncludeBlogs=1

Try these steps:

1. Using FTP or a file manager, delete or rename the mtview.php in your blog's root directory.

2. Then go the Publishing Settings for the blog and hit the Save button.

The try the search again -- does the error still appear?

That worked, thanks a million Mark.

nakedsky [TypeKey Profile Page]:

Hi Mark - Installation appears to have gone fine on MT4, but I get an error when I try to execute a search:

Fatal error: Call to a member function on a non-object in myurl/mt/addons/Commercial.pack/php/init.CustomFields.php on line 11

("myurl" is the URL of my blog...)

I see another user above had a problem with CustomFields and you told him to "wrap that other plugin code in an MTIfStatic container tag". As a novice, I'm not sure what that means or how to do that. And CustomFields is not a plugin, but a built-in feature on the MT4 Commercial Pack. I am using several custom fields in all my entries.

- JP

FYI, it works brilliantly in MT4.01 (although there's the known problem of pages having empty permalinks in search results) but I've tested it in MT 4.1b2 and consistently get a "divide by zero" error after the second result returned, whether I'm doing a regular search or a tag search. The 'fastsearch' template is the same as in 4.01 and downgrading from 4.1b2 to 4.01 fixes the problem. Don't know whether it's FastSearch or MT that's having the issues though!

FYI Just tried it with the final version of 4.1 and I'm still getting the same "divide by zero" error after the second result.

If it's any help, I've narrowed it down to this loop:

">


It seems to be an issue with MTSearchPages at this bit of the code:

if ($ctx->stash('_pages_lastn')) {
$pages = ceil($ctx->stash('_pages_total') / $ctx->stash('_pages_lastn'));
}
$current_page = ($ctx->stash('_pages_offset') / $ctx->stash('_pages_lastn')) + 1;

I think it's also only on the first set of pages. If an offset, etc is specified, there doesn't appear to be a problem with second, etc pages.

Thanks for the details, Rob. I am aware of this issue caused by changes in MT 4.1. Look for an updated version of Fast Search soon.