Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Search Question

Quote Reply
Search Question
Hi:

I have the occasion title that is like: "Quack-A-Doodle-Doo" and a search for "Quack A Doodle Doo" does not turn this up. There are other instances where an unexpected dash between words turns up, and could make the search not find something.

Is there an easy way to put in a regex into the search algo to negate the dashes?
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Search Question In reply to
Hi Dave,

It's because a dash is considered part of a word in the indexer, so it indexes that as one long word. It was done for words like plug-in or gossamer-threads.

If you didn't want this, you could alter the indexer to take it out. It would require changing GT/SQL/Search/Base/Common.pm:

@words = split /[^\w\x80-\xFF\-]+/, lc $text;

to

@words = split /[^\w\x80-\xFF]+/, lc $text;

(get rid of the dash). It would then require rebuilding the search index.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Search Question In reply to
Alex:

THANK YOU. I think- in my luse, it might be better to take out. A LOT of cartoons have dashes you would not expect, and I have seen a lot of "mis-searches" when viewing the search log. For me, I think the modification works...

Thanks again!
dave

Big Cartoon DataBase
Big Comic Book DataBase