Skip to content

Add admin interface for reindexing a project search #4654

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

Closed
5 tasks
agjohnson opened this issue Sep 20, 2018 · 10 comments
Closed
5 tasks

Add admin interface for reindexing a project search #4654

agjohnson opened this issue Sep 20, 2018 · 10 comments
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code

Comments

@agjohnson
Copy link
Contributor

agjohnson commented Sep 20, 2018

We have a management command for this, but a site admin command probably makes a lot more sense. Let's move the management command to a site admin feature.

Work required:

  • On Project admin, a command that reindexes all active versions (project queryset and all attached active versions)
  • On Version admin, a command that reindexes by version queryset instead
  • Drop management command, these aren't good interfaces for site admins and are mostly hidden
  • The management command seems to just do all versions active or not, we should probably test for active versions instead.
  • There should also be an admin function to wipe the index for a version and for a project

I wiped project indexes manually with:

query = {'query': {'bool': {'must': [{'term': {'project': 'docs'}}]}}}
PageIndex.delete_document(query)
SectionIndex.delete_document(query)
@agjohnson agjohnson added Improvement Minor improvement to code Accepted Accepted issue on our roadmap labels Sep 20, 2018
@agjohnson agjohnson added this to the 2.7 milestone Sep 20, 2018
@srikant-ch5
Copy link
Contributor

srikant-ch5 commented Oct 15, 2018

Hi @agjohnson I am interested to work on this issue. I just wanted to ask can someone who is new to this project like me can solve this issue?

@stsewd
Copy link
Member

stsewd commented Oct 15, 2018

Thanks for the interest, I think this kind of depends on #4722

@dojutsu-user
Copy link
Member

@agjohnson I would like to take this issue up.
Can you please guide me on how to get started with this.

@agjohnson
Copy link
Contributor Author

@dojutsu-user great! It might be easiest to raise any specific questions you have. I've outlined the necessary development pieces above, but if you're not familiar with the internal pieces, like Django admin function or Django's management commands, there is a lot of great resources on these in the Django docs.

I will say that this might be blocked by the search upgrade work that we did recently, and have had to back out because of operations issues. I'll ping @ericholscher as he might have a better idea as to whether it makes sense to address this issue now, or after the search work is remerged.

@ericholscher
Copy link
Member

Should be easy enough to do it now, but we should build it knowing that the functionality that we call to index things might change, but that should be a small change in this part of the code.

@dojutsu-user
Copy link
Member

We have a management command for this

I am assuming that this command is python manage.py reindex_elasticsearch -p <project_name>.
right?

I will be making an initial PR soon.

@dojutsu-user
Copy link
Member

One doubt, by the terms Project Admin, Version Admin, did you mean the project and version admin interface provided by the django or the one which is on RTD like readthedocs.org/dashboard/<project-slug>/edit/ ?

@agjohnson
Copy link
Contributor Author

These should be implemented as site admin features -- that is, in the Django admin.

@dojutsu-user
Copy link
Member

This issue can be closed now.

@ericholscher
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

5 participants