@@ -37,13 +37,14 @@ By default, Auto Indexing is turned off in development mode. To turn it on, chan
37
37
After that, whenever a documentation successfully builds, or project gets added,
38
38
the search index will update automatically.
39
39
40
-
41
40
Architecture
42
41
------------
43
42
The search architecture is devided into 2 parts.
44
- One part is responsible for **indexing ** the documents and projects and
45
- the other part is responsible for querying the Index to show the proper results to users.
46
- We use the `django-elasticsearch-dsl `_ package mostly to the keep the search working.
43
+
44
+ * One part is responsible for **indexing ** the documents and projects (`documents.py `)
45
+ * The other part is responsible for **querying ** the Index to show the proper results to users (`faceted_search.py `)
46
+
47
+ We use the `django-elasticsearch-dsl `_ package for our Document abstraction.
47
48
`django-elasticsearch-dsl `_ is a wrapper around `elasticsearch-dsl `_ for easy configuration
48
49
with Django.
49
50
@@ -72,11 +73,11 @@ and index/delete the documentation content from the `HTMLFile` instances.
72
73
73
74
How we index projects
74
75
~~~~~~~~~~~~~~~~~~~~~
76
+
75
77
We also index project information in our search index so that the user can search for projects
76
- from the main site. ` django-elasticsearch-dsl `_ listen `post_create ` and `post_delete ` signals of
78
+ from the main site. We listen to the `post_create ` and `post_delete ` signals of
77
79
`Project ` model and index/delete into Elasticsearch accordingly.
78
80
79
-
80
81
Elasticsearch Document
81
82
~~~~~~~~~~~~~~~~~~~~~~
82
83
@@ -88,9 +89,7 @@ As per requirements of `django-elasticsearch-dsl`_, it is stored in the
88
89
`django-elasticsearch-dsl `_ listens to the `post_save ` signal of `Project ` model and
89
90
then index/delete into Elasticsearch.
90
91
91
- **PageDocument **: It is used for indexing documentation of projects. By default, the auto
92
- indexing is turned off by `ignore_signals = settings.ES_PAGE_IGNORE_SIGNALS `.
93
- `settings.ES_PAGE_IGNORE_SIGNALS ` is `False ` both in development and production.
92
+ **PageDocument **: It is used for indexing documentation of projects.
94
93
As mentioned above, our `Search ` app listens to the `bulk_post_create ` and `bulk_post_delete `
95
94
signals and indexes/deleted documentation into Elasticsearch. The signal listeners are in
96
95
the `readthedocs/search/signals.py ` file. Both of the signals are dispatched
0 commit comments