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

[ic] Prevent search from matching on html


Hello list,

I am finding that when we use HTML in our product descriptions, the search results will include products where an HTML tag matched the search query.

Simple example: if my description contains "<h2>Features</h2>" and someone searches for 'h2', then that product will be returned in the results.

I would like to avoid this, and figured I needed a custom SearchOp, but I'm having no luck with this one:

CodeDef not_tags SearchOp
CodeDef not_tags Routine <<EOR
sub {
        my ($self, $i, $pat) = @_;

        return sub {
            my $string = shift;
            $string =~ s:<[/\w].*?\s?/?>::gi;
            return $string;
        };
}
EOR

The idea is to remove any HTML tags before searching. Any ideas?

Thanks,
Josh
--
Josh Lavin
Kingdom Design   http://www.kingdomdesign.com/

_______________________________________________
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.