[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] swish search - quotes


Dan Bergan <suppressed> wrote:
> However it looks like I will have to do some hacking in Swish.pm it  
> looks like quotes are always removed as "unsafe charachers":
> $spec =~ s/[^-\w()"\s\*]+//g
> 	and $CGI::values{debug}
> 	and ::logError("Removed unsafe characters from search string");
> 
> (My regex skills may be a bit rusty, so please correct me if I'm  
> reading either of these wrong!)
> 
> Does this seem like a reasonable thing for me to do in Swish.pm:
> #removed quote char (") from regex
> $spec =~ s/[^-\w()\s\*]+//g
> 	and $CGI::values{debug}
> 	and ::logError("Removed unsafe characters from search string");
> 
> if ( $s->{mv_exact_match} ) {
>          $spec =~ s/"/\"/g;
> }
> else {
>          $spec =~ s/"//g;
> }
> 
> I'm getting a bit out of my element here, I would rather not have to  
> change a core file, so I would appreciate any easier ways to  
> accomplish this!
> 
Try the Vend::Swish2 module from Interchange 5.5 (CVS).  The setup is
the same, except change "Swish" to "Swish2" in config files.  You should
be able to just dump the lib/Vend/Swish2.pm file into any 5.4.x version,
and probably most other versions too.

Maybe Swish2 will fix your problem and maybe it won't.  I haven't looked
into it.  Swish2 makes use of the SWISH::API module (and friends) instead
of building up a swish-e command line and executing it in a shell.  As
there's no shell, there's no need to remove "unsafe" characters from the
search spec.

My RTFM website uses Interchange 5.5.0 and Vend::Swish2, so you could
try out a couple of searches there to see if you get the kind of results
you might expect.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    suppressed
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/
_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.