[GMG-Devel] Want a new hook for a search plugin

Tom Fay tom at teamfay.co.uk
Thu Dec 3 03:01:22 EST 2015


Hi there,

I've made a search plugin for Mediagoblin so that I can search by 
users/tags as well as description and title (code is at 
https://github.com/tofay/mediagoblin-indexedsearch).

It's really just the existing basicsearch plugin, but queries a whoosh 
index (like the proposal mentioned https://wiki.mediagoblin.org/Search) 
instead of querying the db directly.

Anyways, it creates or updates an index during startup. It can't do this 
by using the "setup" hook because when that hook is called the database 
hasn't been setup yet. I looked into using some sqlalchemy events to 
trigger indexing, but I couldn't find a suitable event.

What I'd like is a hook that notifies plugins when the database has been 
setup. Are there any existing hooks I could use for this purposes, and 
if not can one please be added? On my instance I'm currently just 
calling a new hook at the end of setup_database method.

Thanks,

Tom


More information about the devel mailing list