Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] Swish-e prefs to ignore certain sentences

From: Peter Karman <peter(at)not-real.peknet.com>
Date: Tue Apr 22 2008 - 02:07:10 GMT
Please reply to the list so that others can benefit.

jp@bobschem.com wrote on 4/18/08 6:58 PM:
> Peter & Bill,
> 
> Thanks for the info on callbacks.  I've looked at the docs (at least the
> ones I've been able to find on swish-e.org) and can't glean how to do it.
> 
> http://swish-e.org/docs/spider.html#callback_functions
> 
> Is there a sample of code showing how to block entire sentences with a
> callback? If not, would someone be willing to make a sample?  A PayPal
> 'thank you' would certainly be in order.
> 
> I am eager to learn... just need some more data or a really obvious
> cheat-sheet.
> 

my $sentence =<<EOF;
This is a block of text that
i would like skipped when
indexing.
EOF

my %serverA = (

     filter_content => sub {
         my $content_ref = $_[3];

         $$content_ref =~ s/$sentence//sg;

         return 1;
     },

);



Likewise, if you had an array of sentences to skip, you could put the s/// in a 
foreach loop.


-- 
Peter Karman  .  http://peknet.com/  .  peter(at)not-real.peknet.com
_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Mon Apr 21 22:07:25 2008