mt-search.cgi and mySQL

Per an email question (and so I don’t forget where it is), if you are using MT-Search and mySQL in MT 2.2, you have to make one little change in mt-search.cgi to get it to work.

<update>When the urls for the MT forum change once again, breaking my newly-changed link, the fix is also listed in the comments for this entry.</update>

<update>Jay has released MT Search v1.31b, which incorporates this fix, as well as adding a number of other cool new features.</update>

11 Comments

Comment by Jason Mevius #
2002-07-01 13:53:35

Yep, that did it. Thanks a ton. I looked in the help board, I guess I just missed it.

Jason

 
Comment by Graham #
2002-07-01 14:23:51

Have you given any more thought to a good way to log searches? The random scrap of code I posted in that thread was (clearly) lifted from some other script, and I can’t get it to work.

 
Comment by Phil Ringnalda #
2002-07-01 15:30:10

Actually, I forgot all about it until I needed to track that thread down. I’ll try to keep it closer to the top of the stack, but I’m not sure I’m good enough to do it the way it should be done. Seems to me that it would be best if it stored searches as MT objects, so that they would be conveniently accessible to plugins and tmpls (I’d like to be able to do a tag to list the last ten searches, or be able to put a ”five most recent searches” list below the ”five most recent comments” on the blog editing screen), but I’ve never really looked at if/how you can define, store, and retrieve your own objects. To do.

 
Comment by Jason Mevius #
2002-07-09 10:48:20

Oh, after I wrote about the problem I was having, I realized that the links were pointing to my monthly index only, not the permalink anchor link.

I dug around in /mt/extlib/MT/mods/Search.pm and found the line of code that I *think* controls it (right at the very bottom):

$result_data{’MTENTRYLINK’} = $blog->archive_url . $sep .
$entry->archive_file . ’#’ . (sprintf ”%06d”, $entry->id);

I tried replacing the section ”(sprintf ”%06d”, $entry->id)” with just ”$entry->id”, but it doesn’t pad the zeroes.

Any ideas?

 
Comment by Phil Ringnalda #
2002-07-09 14:54:14

That should be sprintf(”…”, $entry->id);, with the stuff inside the quotes being ”% 0 6 d” (only without the spaces – I can’t remember the ascii code for a percent sign so it won’t get eaten by the textarea). Just need the ( after sprintf rather than before.

 
Comment by esquart #
2002-07-17 04:56:38

Now that the help board archive db is broken, broken, broken -but much faster than before ;)- could you post the ’little change’ required to make MT search work with 2.21 on here ? It’s driving me crazy with its failure to do the do …

I thank you from the bottom of my heart.

 
Comment by Phil Ringnalda #
2002-07-17 09:11:43

That was plenty hard to find: even though I knew exactly what was in the thread I wanted, it took half a dozen sets of search terms to finally find it with ”search.pm mysql”. What you need to do is change one line in Search.pm, from

$self->{’mt’} = MT::App::CMS->new( Config => $param{’mtconfig’} );

to

$self->{’mt’} = MT::App::CMS->new( Config => $param{’mtconfig’}, Directory => ’/full/path/to/mt/directory/’ );

where /full/path/to/mt/directory/ is the local filesystem path (something like /home/users/phil/philringnalda.com/mt/) to the directory with mt.cgi and more importantly mt-db-pass.cgi.

 
Comment by esquart #
2002-07-17 13:48:23

Aha…! Multithanks to you for digging that one out (bumping into forum mislinks all day myself)

gee, I hope they fix the board again….

Happiness is now mine searchwise :)

 
Comment by Norm Jenson #
2002-08-05 21:59:23

I just upgraded to MT 2.2 and installed the 1.31b upgrade and I’m having a problem. My MT directory is onegoodmove.org/movabletype and my blog is in onegoodmove.org/1gm The search engine looks in 1gm for mt-search.cgi instead of in movabletype where it should. Any help will be appreciated.

 
Comment by Norm #
2002-08-05 22:17:11

Please ignore that post. Duh!

 
2002-08-05 04:03:27

MT-Search Version 1.31b released

Due to the big changes (particularly in regards to MT v2.2), I have released an upgrade to MT-Search. The

 

Sorry, the comment form is closed at this time.