[ic] swish search - quotes

Stefan Hornburg (Racke) racke at linuxia.de
Thu Feb 8 04:33:23 EST 2007

Kevin Walsh wrote:
> Dan Bergan <dan at berganconsulting.com> 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.

Swish2 is under development and I plan to extend it for compatibility with
other Interchange search engines and also to use Swish features better.


LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team

More information about the interchange-users mailing list