[pmwiki-users] TextExtract (Search recipe) update

Hans design5 at softflow.co.uk
Sun Sep 27 18:06:36 CDT 2009

Sunday, September 27, 2009, 10:34:33 PM, ABClf wrote:

> I guess there is something strange (0 result). Is that the expected
> new snip process ? I wish I had : X results for Y pages, then the
> extracted lines, pattern hidden, working for pattern in form of
> snip=%.*% (as in the former version, plus counting the snipped text).

I made a change in version 2009-09-17 which affects what you get.
There are two issues:
1. You search for 'eval_' and use snip= to remove %eval_...%
Thereby the row has no matched search term, the matchcount is zero.
To show the number of displayed rows you need to set a custom header=
option which should have {$$rowcnt} instead of {$$matchnum}.
Something like (on one line):

header="%rfloat%{$$rowcnt} results from {$$pagecnt} pages,
 {$$listcnt} pages searched in {$$time} %%[+ '''$[Text Extract]''' +]"

2. As the row has no matches, because they have been removed by snip=,
it is discarded. But you want it as a result. Before version
2009-09-17 it was not discarded. And I probably should reverse this.
Meanwhile you can change extract.php:
comment out ca line 225, the line AFTER if ($row=='') continue;
  # if(!preg_match("($pat)".$qi, $row)) continue;

Both measures 1. and 2. together should solve your problem.

And I need to think about point 2. if it is right to allow rows
which have no matches, because they have been removed in the process.
And what repercussions it may have if we allow such.


More information about the pmwiki-users mailing list