This page may be of use to you. It doesn't provide a specific solution, but may give you info that would help to create said solution.
http://dokuwiki.splitbrain.org/wiki:metadata
You will probably also want to look at the metadata discussion page, and the indexing page, which are both linked from there.