Graphene-django: django-elasticsearch-dsl integration

Created on 9 Oct 2017  路  12Comments  路  Source: graphql-python/graphene-django

I'm adding search to my project using django-elasticsearch-dsl. It provides DocTypes that are similar to Django Models.

I have started work on a new package that roughly mirrors how graphene_django works.

So far I have DocumentObjectType and DocumentConnectionField.

Would it make sense to include that code directly in graphene_django or keep it in a seperate package?

Most helpful comment

I just went back and found the code I had written before.

It is available here:
https://github.com/jeffcjohnson/graphene-elasticsearch

All 12 comments

I think it should be part of its own package. Im also trying to get elasticsearch to work similar to how graphene-django works, are you planning on open sourcing? or have you done a pull request already?

Cool idea! I agree that it definitely belongs in it's own package. If you get that Open Sourced, I bet we could put a link/shout-out in the docs to give you some visibility. Just open a PR with some additions to the docs if you want that. Good luck!

yes, and please update this issue when you do so we can all be notified.

@jeffcjohnson was there ever any additional progress made on your package? Thanks!

@shawnwall I'm sorry, I was pulled into another project and didn't make further progress on this.

I'm also interested in this. Has anyone made progress?

I haven't had time to look into it either, but im going to have to implement something like this pretty soon, I'm hoping in the next two months.
I'm already using graphene with elastic search for auto suggest and having separate classes for indexing seems repetitive.

Is there any update on this topic? I started using django-elasticsearch-dsl and something like DocumentObjectType is gonna be great.

I just went back and found the code I had written before.

It is available here:
https://github.com/jeffcjohnson/graphene-elasticsearch

Could you provide an example on how to use it?

Using the DocumentObjectType instead of ObjectType and pointing it to my ES' Document (through Meta.doc_type), it seems to require a connection and I couldn't find a way to implement one.

@rcostanza I added an examples folder with the code from my old project. I hope that will be enough to show how to wire it up.

Feel free to create issues on that project. I don't have much spare time but it would be nice to make it work with the starwars sample schema.

You're welcome to try https://github.com/barseghyanartur/graphene-elastic

As of today (August 26, 2019) it's still alpha, but going to be beta soon.

Was this page helpful?
0 / 5 - 0 ratings