You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: contributing/search.md
+35
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,41 @@ To sync the indices from your development environment:
26
26
2. Run `npm run sync-search-dry-run`. This takes a while to complete. It will prepare, test, and validate all the indices without actually uploading anything to Algolia's servers.
27
27
3. Run `npm run sync-search` to prepare the indices again and upload them to the Algolia servers.
28
28
29
+
## Build indices for a specific language and/or version
30
+
31
+
You can optionally build indices for a given language and/or a version. This is much faster than building all the indices.
32
+
33
+
You can build them as a dry run, which creates the index locally but does not upload them to Algolia. For example:
34
+
```
35
+
VERSION='free-pro-team@latest' LANGUAGE='en' npm run sync-search-dry-run
36
+
```
37
+
Or you can build and load them to Algolia to make them live:
38
+
```
39
+
VERSION='free-pro-team@latest' LANGUAGE='en' npm run sync-search
40
+
```
41
+
The `VERSION` env var must be a currently supported version in `<PLAN@RELEASE>` format. The `LANGUAGE` env var must be a currently supported two-letter language code.
42
+
43
+
### Label-triggered workflow
44
+
45
+
For our daily shipping needs, the indices are synced to Algolia only after a PR is shipped to the default branch, which means the search data isn't available for up to an hour after the content goes live.
46
+
47
+
But for GHES releases, we have additional needs. We want:
48
+
49
+
1) The search results to be live immediately upon releasing the new content.
50
+
2) The search results to be previewable on the staging app the GHES release megabranch.
51
+
52
+
Manually running `npm run sync` locally before shipping the megabranch can address #1, but it's cumbersome and hard to get the timing right. And it does not address #2.
53
+
54
+
Now, docs team members can use an Actions workflow on GHES megabranch PRs by applying a label in this format:
55
+
```
56
+
sync-english-index-for-<PLAN@RELEASE>
57
+
```
58
+
This label will run a workflow on every push to **build and upload ONLY** the English index for the specified version. This means:
59
+
60
+
* The GHES content will be searchable at the same time the megabranch is shipped, with no delay.
61
+
* The GHES content will be searchable on staging throughout content creation.
62
+
* No manual steps (unless anyone wants to do a dry-run test as described in the previous section).
63
+
29
64
## Files
30
65
31
66
-[.github/workflows/sync-algolia-search-indices.yml](.github/workflows/sync-algolia-search-indices.yml) - the GitHub Actions workflow file that updates search indices whenever the main branch is updated.
0 commit comments