mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-07 22:12:53 +00:00
feat: make backend work with automatically generated aggregations
This commit is contained in:
committed by
Rainer Killinger
parent
496e6c5bd0
commit
ba2c6f655c
13
README.md
13
README.md
@@ -23,27 +23,28 @@ you with everything you need to run this backend.
|
||||
## Generating Elasticsearch Mapping
|
||||
The mappings will be generated automatically on the first start. If there are any errors, the backend will inform you and stop
|
||||
the execution, however it will do its best to complete the mappings. You can then either resolve these errors in the `core-tools` or the `core`, depending on where it originated.
|
||||
If you need a quick solution, you can also take the generated output file and manually correct the errors, then rename it to `template_[coreVersion].json`
|
||||
and restart the backend. This time it will take your file. The filenames and the path will be displayed in the log of the backend.
|
||||
If you need a quick solution, you can also take the generated output file and manually correct the errors, then rename it to `[coreVersion]_template_[type].json` (replace any spaces with a `_`)
|
||||
and restart the backend (make sure that you don't have `ES_FORCE_MAPPING_UPDATE` set to `true`). This time it will take your file. *The filenames and the path will also be displayed in the log of the backend.*
|
||||
|
||||
### Manually Resolving Errors
|
||||
There are multiple types of errors the backend can run into. Manual error resolving requires you to be familiar with Elasticsearch
|
||||
mappings.
|
||||
An error will be represented in the output through an Elasticsearch type written in CAPS. Refer to either the console output
|
||||
or the `error_report_[coreVersion].txt` for more info. If you feel lucky you can try to replace every error (`"type": "MISSING_PREMAP"`,
|
||||
or the `[coreVersion]_error_report.txt` for more info. If you feel lucky you can try to replace every error (`"type": "MISSING_PREMAP"`,
|
||||
`"type": "PARSE_ERROR"`, `"type": "TYPE_CONFLICT"`) with
|
||||
```json
|
||||
"dynamic": true,
|
||||
"properties": {}
|
||||
```
|
||||
This should ONLY be used as a temporary workaround.
|
||||
This should ONLY be used as a temporary workaround and might compromise other features.
|
||||
|
||||
### Startup Behaviour
|
||||
*This might be important if you work on the Core*
|
||||
|
||||
The backend is using the `core-tools` to automatically generate Elasticsearch Mappings and Aggregations from the current `core` version.
|
||||
|
||||
By default, the backend creates a local copy of the generated mappings in `src/storage/elasticsearch/templates/template_[coreVersion].json`.
|
||||
On each start, it first checks if this file exists, if it does, it will just use that file and *not* generate a new mapping to cut down the time
|
||||
By default, the backend creates a local copy of the generated mappings and aggregations in `src/storage/elasticsearch/templates/[coreVersion]_template_[type].json` and `src/storage/elasticsearch/templates/[coreVersion]_aggregations.json`.
|
||||
On each start, it first checks if the aggregation file exists, this is because it does not know which of the types actually exist for the current core version. If the file does exist, it will just use the existing files and *not* generate a new mapping to cut down the time
|
||||
it takes to start the backend. When you are working on the Core, you might not want to have this behaviour, you can then either delete
|
||||
the generated file at each start or run the backend with the environment variable `ES_FORCE_MAPPING_UPDATE=true`. This will cause it to generate the mapping
|
||||
each time starts regardless of whether there are already files there.
|
||||
|
||||
Reference in New Issue
Block a user