Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [SeanP] Stop Words Global...

Quote Reply
Re: [SeanP] Stop Words Global... In reply to
Ideally you'd want this as a plugin so it would not even do the search if it was a custom stop word.

However, a global will work and you are on the right track. How about something like:

format_error =>

Code:
sub {
my $tags = shift;
my $query = $IN->param('query');
my %stopwords = map { $_ => 1 } qw/a stop word list goes here they should be space separated/;
if (length $query < 3) {
return "Your query is to short.";
}
if (exists $stopwords{$query}) {
return "The word '$query' is a stopword.";
}
return $tags->{error}; # Display default error
}


and then do:

<%if error%>
Error: <%format_error%>
<%endif%>

Hope this helps,

Alex
--
Gossamer Threads Inc.
Subject Author Views Date
Thread Stop Words Global... SeanP 6372 Apr 26, 2002, 10:09 AM
Thread Re: [SeanP] Stop Words Global...
Alex 6253 Apr 26, 2002, 1:24 PM
Post Re: [Alex] Stop Words Global...
SeanP 6174 Apr 26, 2002, 1:42 PM
Thread Re: [Alex] Stop Words Global...
SeanP 6190 Apr 26, 2002, 6:44 PM
Thread Re: [SeanP] Stop Words Global...
Ian 6202 Apr 27, 2002, 8:11 PM
Thread Re: [sooke] Stop Words Global...
SeanP 6142 Apr 27, 2002, 10:14 PM
Post Re: [SeanP] Stop Words Global...
Ian 6163 Apr 27, 2002, 10:16 PM
Post Re: [Alex] Stop Words Global...
SeanP 6086 May 1, 2002, 9:52 AM
Thread Re: [Alex] Stop Words Global...
SeanP 6088 May 7, 2002, 5:18 PM
Thread Re: [SeanP] Stop Words Global...
SeanP 6040 May 10, 2002, 8:13 AM
Post Re: [SeanP] Stop Words Global...
SeanP 6047 May 10, 2002, 10:25 AM
Thread Re: [SeanP] Stop Words Global...
SSmeredith 5765 Feb 14, 2003, 5:59 AM
Post Re: [SSmeredith] Stop Words Global...
Paul 5736 Feb 14, 2003, 4:42 PM
Thread Re: [SSmeredith] Stop Words Global...
Andy 5737 Feb 15, 2003, 2:03 AM
Thread Re: Stop Words Global...
SSmeredith 5712 Feb 15, 2003, 5:43 AM
Post Re: [SSmeredith] Stop Words Global...
Andy 5719 Feb 15, 2003, 6:08 AM