MidCOM 2.4 Status Report: Indexer Progress
2005-02-22 20:52

It has been quiet on the MdiCOM front in my Blog for a while. Oh, not because there was no progress. To the contrary, the last few days brought quite a bit of interesting code into the core, up and foremost a first, working of the MidCOM Indexer Integration Proof-of-Concept.

Right now, what you have in CVS on the main trunk is a working version of the so-called XML Shell Indexer Backend. It uses the MidCOM Remote Indexing Service: XML communication protocol outlined in mRFC 14. This implementaion will probably not be usable for really high volume sites, as each time MidCOM communicates with the Indexer Backend a new shell process is being spawned. Nevertheless the reaction times seem well enough for small to average scale sites to me.

The current code is only roughly tested, but current testing shows that indexing and querying works in general. Of course, it will take a bit of time until this whole piece of code stabilizes, naturally.

At this time, I have crudly patched the taviewer saving sequence to invoke the indexer, while this is no real live solution, it shows how easy the new indexer system can be used:

$indexer =& $GLOBALS['midcom']->get_service('indexer');
$document = new midcom_services_indexer_document_datamanager

The interesting part here is the fact, that there was absolutely no need to change anything else, the default indexer behavoir for datamanger documents is sufficient for the average usage of the Indexer. Details can be found in the documentation of the datamanager document class.

The next step is to think about component integration. I plan to have a new config directive to the datamanager schema which will allow to turn on indexing globally and in on a per-schema basis. While this would make indexing available for most components without further work, I am not sure where exactly this should go, especially the question how to treat unindexed sites should be taken into account.

Also, the indexer service should get a number of helper methods, which allow to further strip down the code above (saving the document instantination, if possible).

Most probably, the components will need to check wether indexing is enabled in any case, as they need to update the index when deleting records too.

As you can see, the progress is good, even if I have a few loose ends here right now, when it comes down to component integration. I'll sleep over this for now, maybe I'll have an idea about this tonight. If not, bet I'll bother all of you fellow Midgardians in IRC tomorrow ;-).

A final word, under the chapter also in the news: These days you'll get a few more technical notes documents from me, focussing on how to upgrade to 2.4 (for testing systems, that is) and where you need to turn the screws to get the indexer working (both as a site admin and as a component author).