[MKDoc-dev] Handling Component Deletion

Bruno Postle bruno at mkdoc.com
Sun Oct 24 17:06:33 BST 2004


On Sat 23-Oct-2004 at 14:27 -0400, Sam Tregar wrote:

> As it stands there's no code in place to delete the index data
> when the component is deleted.

>   1) Create a new method in flo::Component called on_delete() which is
>      called when a component is removed.

Presumably the Document_TimeRange table is updated when the document
is saved rather than when the component is modified.  What about
deleting/reinserting all timerange entries associated with the
document each time the document is saved?

>   2) Move maintenance of the Document_TimeRange index to an external
>      cron-job, like the existing indexing system.

The indexing script currently takes a parameter of seconds, it
only reindexes documents where the 'last modified' date is recent.
So typically we run it every hour and tell it to reindex documents
modified in the last 5400 seconds.

We could actually run it every minute with a parameter of 90
seconds, but it then causes high server-loads when somebody does a
mass import of ten thousand documents and you end up with multiple
indexer instances running concurrently.

..but then we have never done any tuning, probably running it every
five minutes with a parameter of 301 seconds would be fine.

I think this sort of delay would be ok for event components too.

> If possible I'd like to find a solution to the problem with #1.
> It seems cleaner to me to confine all the time-range logic in a
> single module than to spread it across a module and an indexing
> script.  Any suggestions?

This problem will recur at a later date and may have a generic
solution; we currently store 'link components' similarly in the
Document.Body, meaning there is no practical way to search links
unless we someday create a Document_Link table.

-- 
Bruno


More information about the MKDoc-dev mailing list