mediagoblin-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Tom Fay
Subject: Re: [GMG-Devel] Want a new hook for a search plugin
Date: Tue, 12 Jan 2016 19:48:42 +0000
User-agent: Zoho Mail

Hi Praveen and Christopher,

I did read Praveen's report, and but I couldn't find a working plugin in your repos so wrote a simple one. I'd have liked to use a backend agnostic library like haystack, but it's closely tied to django so I went with the same whoosh backend as Praveen. It only handles media entries, which is sufficient for me at the moment, but it does index existing entries. It's fairly well UT'd but hasn't had much testing: AFAIK it's only used by me on a tiny instance!

Christopher: I probably don't need a new plugin (I'm just using the wrap_wsgi one at the moment, at which point the db and celery is already setup). I'll take a look at the overlap between the functions of mine and Praveen's.

Cheers,
Tom


---- On Wed, 06 Jan 2016 17:54:21 +0000 Praveen Kumar <address@hidden>wrote ----

Hey Christopher, Tom!

I would be more than happy to help get this integrated with MediaGoblin. I can 
collaborate with Tom or work on re-implementing the search plugin from scratch.
I guess I had added the script to index the existing items but I may be wrong.


On Mon, Jan 4, 2016 at 8:57 AM, Christopher Allan Webber <address@hidden> wrote:
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
> 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

Heya Tom,

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
month....

Happy hacking!
 - cwebb

_______________________________________________
devel mailing list



--
Cheers

Praveen


reply via email to

[Prev in Thread] Current Thread [Next in Thread]