[thelist] Highlighting a keyword within posting retrieved

klute soundres9 at yahoo.com
Mon Apr 23 09:44:22 CDT 2007


Hassan,

Good points (once again)

Yeah, MySQL's fulltext search is smart enough to not
return entries containing "JavaScript" for searches
for "Java"

Regex it is ;)

Cheers,
James

--- Hassan Schroeder <hassan.schroeder at gmail.com>
wrote:

> On 4/21/07, klute <soundres9 at yahoo.com> wrote:
> 
> >  Regex may be the way to go
> > but it comes with this challenge: I can't really
> do a
> > straight search and replace of the actual keyword
> with
> > SPAN since that keyword can be a part of another
> > (potentially unrelated) word.
> 
> Um, "part of"? -- I don't think MySQL text search
> handles that...
> 
> It depends on your exact requirements, of course,
> but your examples
> all look like a non-word character -- \W -- followed
> by your keyword
> followed by another non-word character; that's a
> single replacement.
> 
> > I wish there was a regex library or something that
> > does what a search against a fulltext index does
> in
> > MySQL.
> 
> The only real problem I can see is with stemming,
> which -- if I recall
> correctly, and it's been a while since I've done
> this -- is a bit of a weak
> point with MySQL's text search, anyway. Grain of
> salt, etc.
> 
> I mean, even Lucene doesn't have a built-in stemmer,
> and that's just
> nuts. But since I haven't volunteered to fix it, I
> can't complain, can I? :-)
> 
> In any case, I'd just try a \Wkeyword\W replacement
> and see how many
> cases that hits.
> 
> FWIW,
> -- 
> Hassan Schroeder ------------------------
> hassan.schroeder at gmail.com
> -- 
> 
> * * Please support the community that supports you. 
> * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip
> Harvester 
> and archives of thelist go to:
> http://lists.evolt.org 
> Workers of the Web, evolt ! 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the thelist mailing list