On 11/19/2010 04:30 AM, Michael Hamann wrote:
Yes, that's true, but there are also plugins that will/do write metadata not in their syntax plugin and thus not everytime the renderer is called but e.g. just when a page is saved and the plugin processes it's additional form fields. And this metadata has to be saved as persistent, so it will remain there when the plugin is uninstalled.
And the PARSER_METADATA_RENDER event also triggers during rendering. So that's an alternative to providing a syntax plugin. But you're also suggesting data that is added to a page without causing it to be re-rendered. This could be dynamically generated content, like recent commits from a VCS. Or votes cast by a poll plugin. Is data not created during rendering truly "metadata" or just plugin-private data?
I think the answer to that is "yes". So I see what you're asking for. DW needs a few functions to allow modifying the metadata without forcing the page to be rerendered. As far as the indexer is concerned, putting metadata in the index is the same whether it's being rendered or updated out-of-band. Just addMetaWords($page, "key", $value). The trick is that this doesn't affect other keys or the page content. And if you want to remove a key, just use an empty value.
The tag plugin just uses a serialized array of the form array('id' => array('tags')) (see
Yes, I was mistaken. It only reads the page index. In any case, can you think of a reason why word IDs can't be shared?
Yes, of course, but it also shows some problems with adding metadata to the main word index as e.g. a tokenizer could be run afterwards. So we need to make sure that metadata is also handled by external indexers as it should.
That could be a problem. It breaks the "it's all text" assumption. If some text (URLs, dates) are special then they need different tokenizers, searchers, etc.
I'm inclined to treat everything the same if only because it's easier to write code for.
What we need is thought-out well enough for me to start rewriting inc/indexer.php using this api http://whoopdedo.org/doku/indexer. Managing the keys and hooks and search results are different sub-tasks that I won't dwell too much on at this time.
-- - tom telliamed@xxxxxxxxxxxxx -- DokuWiki mailing list - more info at http://www.dokuwiki.org/mailinglist