|Subject:||Re: [GMG-Devel] Want a new hook for a search plugin|
|Date:||Wed, 6 Jan 2016 23:24:21 +0530|
Tom Fay writes:
> 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
> 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.
Interesting stuff! Have you also looked at the work on search in
MediaGoblin that was done by Praveen Kumar? I believe it's at
Unfortunately, though I would like to see it merged, it hasn't been. I
feel guilty about this because Praveen did a lot of good work and I'd
love to see those ideas integrated.
I think your concerns about setup/teardown are valid. Though, one
thought I've had is maybe there should be either some "larger" command
that is like "gmg updateall" or something that can run both dbupdate and
some other search related command.
One thing missing from Praveen's branch at present is the ability to
index media that already existed... so far it only exists new items.
If there are new hooks that should be added, we can add them. If you're
interested in suggesting where they should go, or fielding a patch, I
could give it a try.
Would you also be interested in looking at Praveen's branch and seeing
how much overlap there is?
Thanks! And sorry about the delay in replying, it's been a busy
devel mailing list
|[Prev in Thread]||Current Thread||[Next in Thread]|