Repository navigation
Update documentation to reflect transition from Elasticsearch to OpenSearch #5677
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 3.3.9 | ||
| 3.4.1 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| --- | ||
| owner_slack: "#govuk-search" | ||
| title: Add a new field to an OpenSearch document type | ||
| parent: "/manual.html" | ||
| layout: manual_layout | ||
| section: Search on GOV.UK | ||
| related_repos: [search-api] | ||
| --- | ||
|
|
||
| ## The OpenSearch schema | ||
|
|
||
| `config/schema` contains JSON files that together define a schema for documents in Search API. This is described in more detail in the | ||
| [schema documentation][schema-documentation]. | ||
|
|
||
| When adding a new field, first you need to decide which field type to use. | ||
| `field_types.json` defines common OpenSearch configuration that we reuse for multiple fields having the same type. | ||
|
|
||
| The type you use affects whether the field is [analysed][] by OpenSearch and whether you can use it in [filters][] and [aggregates][]. | ||
|
|
||
| Add your new field to `field_definitions.json`. | ||
|
|
||
| If your field should be valid for any kind of document, you can add it to `base_opensearch_type.json`. Otherwise, add it to the appropriate JSON file under `elasticsearch_types`. | ||
|
|
||
| ## Integration testing | ||
|
|
||
| The easiest way to test the new fields is to write an integration test for it. These tests run against a development OpenSearch cluster, and create new search indices each test run. | ||
|
|
||
| ## Updating Search API schema indexes on all environments | ||
|
|
||
| In order for the new field to work as expected, you will need to reindex OpenSearch. Follow the guidance on [how to reindex OpenSearch][reindex-guide]. | ||
|
|
||
| If you consider the change low risk and are only adding new fields for which content doesn't yet exist, you can run the `search:update_schema` [task][update-schema-task]. | ||
| This task will attempt to update the OpenSearch index schema in place without requiring a re-index. | ||
| If you have made any changes which affect existing fields, OpenSearch will reject the change and a full re-index will be required. | ||
|
|
||
| [schema-documentation]: https://docs.publishing.service.gov.uk/repos/search-api/schemas.html | ||
| [analysed]: https://docs.opensearch.org/latest/analyzers/ | ||
| [filters]: https://docs.opensearch.org/latest/query-dsl/ | ||
| [aggregates]: https://docs.opensearch.org/latest/aggregations/ | ||
| [reindex-guide]: https://docs.publishing.service.gov.uk/manual/reindex-opensearch.html | ||
| [update-schema-task]: https://github.com/alphagov/search-api/blob/main/lib/tasks/indices.rake#L131-L149 |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we also rename this file to |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| --- | ||
| owner_slack: "#govuk-searchandnav" | ||
| title: Elasticsearch cluster health | ||
| title: OpenSearch cluster health | ||
| parent: "/manual.html" | ||
| layout: manual_layout | ||
| section: Icinga alerts | ||
| --- | ||
|
|
||
| Elasticsearch reports cluster health as one of three possible states, based on | ||
| OpenSearch reports cluster health as one of three possible states, based on | ||
| the state of its [primary and replica shards][primary-and-replica-shards]. | ||
|
|
||
| - `green` - all primary and secondary (replica) shards are allocated. There are | ||
|
|
@@ -18,17 +18,17 @@ the state of its [primary and replica shards][primary-and-replica-shards]. | |
| entire cluster is cold started, before it's initially allocated the primary | ||
| shards. If it happens at other times this may be a sign of data loss. | ||
|
|
||
| [primary-and-replica-shards]: https://www.elastic.co/guide/en/elasticsearch/reference/2.4/_basic_concepts.html#_shards_amp_replicas | ||
| [primary-and-replica-shards]: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-health/ | ||
|
|
||
| More [comprehensive documentation on cluster health][cluster-health-endpoint] | ||
| can be found in the Elasticsearch documentation. | ||
| can be found in the OpenSearch documentation. | ||
|
|
||
| Make sure you understand the consequences of the problem before jumping to a | ||
| solution. | ||
|
|
||
| Icinga uses the `check_elasticsearch_aws` check from [nagios-plugins][] to | ||
| monitor the health of the AWS managed Elasticsearch cluster. This plugin uses | ||
| various endpoints of the Elasticsearch API, but also extrapolates additional | ||
| monitor the health of the AWS managed OpenSearch cluster. This plugin uses | ||
| various endpoints of the OpenSearch API, but also extrapolates additional | ||
| information to help you diagnose any problems. | ||
|
|
||
| [nagios-plugins]: https://github.com/alphagov/nagios-plugins/ | ||
|
|
@@ -43,13 +43,13 @@ There are tabs for 'Cluster health' and 'Instance health'. The graphs in the | |
| console link to AWS Cloudwatch, where historic metrics can be viewed over custom | ||
| time periods. | ||
|
Comment on lines
29
to
44
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if this whole section can be removed? It looks like the nagios-plugins repo was archived in 2020.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this whole section and others need updating. Much of this hasn't been updated since 2017/2019! I wrote a new card for this: https://gov-uk.atlassian.net/browse/SCH-2389 |
||
|
|
||
| #### Use the Elasticsearch API | ||
| #### Use the OpenSearch API | ||
|
|
||
| An alternative to using the dashboard is accessing the Elasticsearch health API | ||
| An alternative to using the dashboard is accessing the OpenSearch health API | ||
| yourself. Start with the [`/_cluster/health` endpoint][cluster-health-endpoint] | ||
| and go from there. | ||
|
|
||
| [cluster-health-endpoint]: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-health.html | ||
| [cluster-health-endpoint]: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-health/ | ||
|
|
||
| Response JSON from the `/_cluster/health` endpoint looks like: | ||
|
|
||
|
|
@@ -68,14 +68,14 @@ Response JSON from the `/_cluster/health` endpoint looks like: | |
| } | ||
| ``` | ||
|
|
||
| A tunnel to Elasticsearch in a specific environment (e.g staging) can be created | ||
| A tunnel to OpenSearch in a specific environment (e.g staging) can be created | ||
| using the following: | ||
|
|
||
| ``` | ||
| gds govuk connect ssh --environment staging search -- -N -L 9200:elasticsearch6:80 | ||
| gds govuk connect ssh --environment staging search -- -N -L 9200:selasticsearch6:80 | ||
| ``` | ||
|
|
||
| Elasticsearch will then be available at <http://localhost:9200>. | ||
| OpenSearch will then be available at <http://localhost:9200>. | ||
|
|
||
| #### Logging | ||
|
|
||
|
|
@@ -85,7 +85,7 @@ Access to logs is detailed in the [logging documentation](/manual/logging.html#e | |
|
|
||
| GOV.UK have a Enterprise level support plan with AWS for staging and | ||
| production. Since we are using a managed service, AWS should be the first point | ||
| of contact for fixing issues with the Elasticsearch cluster. They can be | ||
| of contact for fixing issues with the OpenSearch cluster. They can be | ||
| contacted by telephone, live chat or support request. | ||
|
|
||
| Response times are: | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also rename this file?