Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support passing an explicit index_name for search indexing #5239

Merged
merged 1 commit into from Feb 6, 2019

Conversation

@ericholscher
Copy link
Member

@ericholscher ericholscher commented Feb 6, 2019

This is a bit of a hack, but it will work for now.

This is a bit of a hack, but it will work for now.
@ericholscher ericholscher requested a review from safwanrahman Feb 6, 2019
@safwanrahman
Copy link
Member

@safwanrahman safwanrahman commented Feb 6, 2019

I think we can move to the previous approach where we could pass the index_name in the update method by overriding the default DocType class of django-elasticsearch-dsl

@ericholscher
Copy link
Member Author

@ericholscher ericholscher commented Feb 6, 2019

Yea, that just leads to a lot of code that we're copy/pasting into our project, which feels more brittle.

humitos
humitos approved these changes Feb 6, 2019
Copy link
Member

@humitos humitos left a comment

I don't find the hack too hacky. Doesn't look to bad, actually.

@safwanrahman
Copy link
Member

@safwanrahman safwanrahman commented Feb 6, 2019

It will provide the wrong index name to the tasks that are running during the doc_obj.update(queryset.iterator()). I think its better to avoide the hacky way if we can do from our end.

Yea, that just leads to a lot of code that we're copy/pasting into our project, which feels more brittle.

I am hoping to implement it to the django-elasticsearch-dsl package as well. I think that time we do not need this much of code. But till then, I think its good to have that code in our project.

@ericholscher
Copy link
Member Author

@ericholscher ericholscher commented Feb 6, 2019

It will provide the wrong index name to the tasks that are running during the doc_obj.update(queryset.iterator()). I think its better to avoide the hacky way if we can do from our end.

I tested it and it seems to work fine.

@ericholscher ericholscher merged commit a6dbefc into master Feb 6, 2019
1 of 2 checks passed
@delete-merged-branch delete-merged-branch bot deleted the fix-reindexing branch Feb 6, 2019
@ericholscher
Copy link
Member Author

@ericholscher ericholscher commented Feb 6, 2019

Going to merge this so we can ship it, but we should come back to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants