From 65e1f5657a17ab751f021e7b2a497b1e6ce33d5e Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Sun, 30 Sep 2018 17:18:09 +0200 Subject: [PATCH] Fix bug where we were not indexing Sphinx HTMLDir projects Also try and fix a bug with queue selection around reindexing. --- readthedocs/search/documents.py | 2 +- readthedocs/search/management/commands/reindex_elasticsearch.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/readthedocs/search/documents.py b/readthedocs/search/documents.py index af9095dcc77..8520f90e71e 100644 --- a/readthedocs/search/documents.py +++ b/readthedocs/search/documents.py @@ -120,6 +120,6 @@ def get_queryset(self): # Do not index files that belong to non sphinx project # Also do not index certain files - queryset = (queryset.filter(project__documentation_type='sphinx') + queryset = (queryset.filter(project__documentation_type__contains='sphinx') .exclude(name__in=self.excluded_files)) return queryset diff --git a/readthedocs/search/management/commands/reindex_elasticsearch.py b/readthedocs/search/management/commands/reindex_elasticsearch.py index aab8d3cddf8..47b15cd4f15 100644 --- a/readthedocs/search/management/commands/reindex_elasticsearch.py +++ b/readthedocs/search/management/commands/reindex_elasticsearch.py @@ -78,7 +78,9 @@ def _run_reindex_tasks(self, models, queue): # http://celery.readthedocs.io/en/latest/userguide/canvas.html#chords chord_tasks = chord(header=indexing_tasks, body=post_index_task) if queue: + pre_index_task.set(queue=queue) chord_tasks.set(queue=queue) + missed_index_task.set(queue=queue) # http://celery.readthedocs.io/en/latest/userguide/canvas.html#chain chain(pre_index_task, chord_tasks, missed_index_task).apply_async(**apply_async_kwargs)