Skip to content

Commit 52217c8

Browse files
authored
Replaced search field with generated vector field (#2192)
1 parent b1eb535 commit 52217c8

File tree

9 files changed

+1710
-114
lines changed

9 files changed

+1710
-114
lines changed

README.rst

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Install and run locally from a virtual environment
8484
#. For docs (next step requires ``gettext``)::
8585

8686
python -m manage loaddata doc_releases
87-
python -m manage update_docs --update-index
87+
python -m manage update_docs
8888

8989
#. For dashboard:
9090

@@ -233,16 +233,8 @@ minified version of it to this directory.
233233
Documentation search
234234
--------------------
235235

236-
When running ``python -m manage update_docs --update-index`` to build all
237-
documents it will also automatically index every document it builds in the
238-
search engine as well. In case you've already built the documents and would like
239-
to reindex the search index, run the command::
240-
241-
python -m manage update_index
242-
243-
This is also the right command to run when you work on the search feature
244-
itself. You can pass the ``-d`` option to try to drop the search index
245-
first before indexing all the documents.
236+
When running ``python -m manage update_docs`` to build all documents it will
237+
also automatically index every document it builds in the search engine as well.
246238

247239
Updating metrics from production
248240
--------------------------------

docker-entrypoint.dev.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ python -m manage loaddata doc_releases
1212
python -m manage loaddata dashboard_production_metrics
1313
# python -m manage loaddata dashboard_example_data
1414
python -m manage update_metrics
15-
#python -m manage update_index
1615

1716
exec "$@"

docs/management/commands/update_docs.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ def add_arguments(self, parser):
4747
action="store_true",
4848
help="Ask before building each version",
4949
)
50-
parser.add_argument(
51-
"--update-index",
52-
action="store_true",
53-
dest="update_index",
54-
default=False,
55-
help="Also update the search vector field.",
56-
)
5750
parser.add_argument(
5851
"--purge-cache",
5952
action="store_true",
@@ -98,25 +91,19 @@ def _get_doc_releases(self, versions, options):
9891

9992
def handle(self, *versions, **kwargs):
10093
self.verbosity = kwargs["verbosity"]
101-
self.update_index = kwargs["update_index"]
10294
self.purge_cache = kwargs["purge_cache"]
10395

10496
self.default_builders = ["json", "djangohtml"]
10597

10698
# Keep track of which Git sources have been updated, e.g.,
10799
# {'1.8': True} if the 1.8 docs updated.
108100
self.release_docs_changed = {}
109-
# Only update the index if some docs rebuild.
110-
self.update_index_required = False
111101

112102
for release in self._get_doc_releases(versions, kwargs):
113103
self.build_doc_release(
114104
release, force=kwargs["force"], interactive=kwargs["interactive"]
115105
)
116106

117-
if self.update_index_required:
118-
call_command("update_index", **{"verbosity": self.verbosity})
119-
120107
if self.purge_cache:
121108
changed_versions = {
122109
version
@@ -172,8 +159,6 @@ def build_doc_release(self, release, force=False, interactive=False):
172159
)
173160
return
174161

175-
self.update_index_required = self.update_index
176-
177162
source_dir = checkout_dir.joinpath("docs")
178163

179164
if release.lang != "en":
@@ -288,15 +273,6 @@ def zipfile_inclusion_filter(file_path):
288273
if release.is_default:
289274
self._setup_stable_symlink(release, built_dir)
290275

291-
#
292-
# Rebuild the imported document list and search index.
293-
#
294-
if not self.update_index:
295-
return
296-
297-
if self.verbosity >= 2:
298-
self.stdout.write(" reindexing...")
299-
300276
json_built_dir = parent_build_dir.joinpath("_built", "json")
301277
documents = gen_decoded_documents(json_built_dir)
302278
release.sync_to_db(documents)

docs/management/commands/update_index.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)