[pmwiki-users] TextExtract (Search recipe) update

Hans design5 at softflow.co.uk
Sat Sep 12 01:49:49 CDT 2009

Friday, September 11, 2009, 8:13:49 PM, ABClf wrote:

> I'm not sure I can use one more time this thread for two questions unrelated to Oliver Betz's will.
> Tell me if I'm wrong, no problem, sorry ; I just though it was tolerable to keep on this thread.

Of course it is perfectly alright! I need feedback and bug reports
in order to improve the recipe! I am most thankful to your

> So : 
> (1) Hans, can your confirm that one can't scan a #delimited#section
> in every page (something like : Group.*#beginsection#endsection) ?
> Everytime I test something to make it work, I get a «No pages to be searched!» message.

This won't work, because adding the anchors to a pagename including
wildcards will not match any pages when the source pagelist is
generated. Pagenames with anchors work, but not wildcard pagenames
with anchors.

> What I was testing here is to use TextExtract in place of an include pagelist like :
> (:pagelist "[[#todo]]" name=-Modele*,-AFaire Group=Group fmt=#includetodo order=name:)

> (Which one would be the more efficient ? native include pagelist ou
> section-limited Textextract process ?)

You need to use pagelist, for the reason given above.

> (2) I use TextExtract on a page to collect everywhere in the Group
> I wrote some hidden comment : %eval_xxx% (so that I can show all
> sentences I prefixed with that comment markup).
> Here it is my query : 
> {(extract 'eval_' Group.*,-RecentChanges markup=on title=Listage
> header=full timer=1 unit=line prefix=link snip=%.*%)}
> This works fine, I get the results I want but something I don't
> like is that it prints *0 results* although there are 41 matches : «
> 0 results    on 41 pages from 394 pages searched »
> I guess the reason is I queried some hidden markup ? 

Not because it is markup which hides text.
What happens is that the results are calculated by summing up the
matches found in each row. But you are using the snip= parameter to
remove the found match, so it is not counted. I will look into this
to see if it can accomodate such case, sinc eit clearly returns the
row with the match. So there is a bug there.

You also use unit=line and markup=on.
This should really be disallowed, since enabling markup for a single
row can often have disasterous results for the rendering, since
closing markup may well be missing.
You better use unit=line markup=cut , or markup=code.

> (3) Is there any way to print the header (title and time) but not show the results ?

Not so far. I see if I can add it.


More information about the pmwiki-users mailing list