On Sun, 25 Aug 2002, andy wrote:

> Hi there,
> 
> I am trying to write a php script to perform a full text search on a mysql
> db. I do a match against... and it digs out some results out of the db.
> 
> There are 2 problems:
> 
> 1. <snip>
> 2. Is it possible with php to underline the keyword inside the search
> results. This might be more tricky.

Andy,

I am working on the same problem. So far I figured out that it must be
handled outside MySQL. My application (a bash script) creates a
sed script on the fly and pipes the result through sed.

Code fragment looks like:

cat /dev/null > $SEDSCR
for wrd in $MARK ; do
        echo "s|$wrd|<font color=\\"#FF0000\\">&</font>|Ig" \
        >> $SEDSCR
done

and then 

echo "$QUERY" | mysql $MYOPTS | sed -f $SEDSCR

The problem is to eliminate unused keywords the same way as MySQL does. I
have quite an extensive stopword list ft_static.c. Good ideas how to
handle this are welcome. The biggest problem is the way ft search handles
ignored words. This is hard to repeat outside MySQL.

Thomas Spahni
-- 
filter: sql query


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to