[pmwiki-devel] .pageindex

Petko Yotov 5ko at 5ko.fr
Sun Feb 5 01:36:55 PST 2023


On 05/02/2023 00:00, Simon wrote:
> Is there documentation available on the .pageindex ?

Here is something from Pm on the mailing list:

   https://www.pmwiki.org/pipermail/pmwiki-users/2006-June/029028.html

You can search the mailing list for "pageindex from:pmichaud" here:

   https://www.pmwiki.org/search-ml.php?split=v


All this is handled by functions in scripts/pagelist.php, search for 
$PageIndexFile.

Basically, when you save a page, wiki.d/.pageindex is updated for that 
page.

When someone searches, or there is a pagelist with search terms, or 
arguments link= or category=, first .pagelist is scanned, then pages, 
and if .pageindex is not up-to-date for some pages, the pages are added 
to a queue to be indexed later. The queued pages are indexed in batches 
of 10 seconds max.


> Can a user recipe add or remove terms in the page index.
> e.g. each time a page is called or updated, or uploads are added or 
> removed to a page, a user recipe recipe removes or updates terms it 
> added last time, and adds terms to the .pageindex

Every time a page is saved, .pageindex is updated, this means, the new 
attachment file names are added to the .pageindex for that page, 
attachments that were removed are also excluded from the .pageindex 
entry for the page.

If you edit pages programmatically, or have a recipe action that 
modifies a page, I recommend you call the function UpdatePage($pagename, 
$page, $new) to save your pages, this way the .pageindex will be updated 
automatically (but also ROSPatterns, recent changes, page history, and 
all other benefits).

Petko



More information about the pmwiki-devel mailing list