3
0
Fork
You've already forked elasticsearch
0
Scripts for maintaining a local Elasticsearch instance
  • Shell 100%
2025年10月19日 18:47:11 +02:00
custom-mappings feat: Add custom mappings support, and add one for virology. 2025年10月19日 13:22:42 +02:00
migration feat: Add another migration script to remove IDs. 2025年10月17日 10:40:12 +02:00
.gitignore chore: Fix gitignore. 2025年10月17日 10:15:44 +02:00
COPYING feat: Initial scripts that I built while hacking on this. Needs work. 2025年10月17日 09:57:35 +02:00
create-index feat: Silence curl, but show errors if they occur. 2025年10月19日 18:47:11 +02:00
delete-index feat: Silence curl, but show errors if they occur. 2025年10月19日 18:47:11 +02:00
find-doi feat: Silence curl, but show errors if they occur. 2025年10月19日 18:47:11 +02:00
mapping.json feat: Set maximum reasonable value for ignore_above. 2025年10月17日 16:38:48 +02:00
README.md docs: Add docs for ID removal script. 2025年10月17日 15:09:17 +02:00
upload-document feat: Silence curl, but show errors if they occur. 2025年10月19日 18:47:11 +02:00

Elasticsearch Scripts

Here we keep scripts useful for spinning up an Elasticsearch instance on top of our JSON files that can help us search over and query them.

  • Scripts:
    • upload-document [index] [file]: Upload a single JSON document to ES.
  • Utility files:
    • mapping.json: A mapping and settings file that can be used to build a new ES index that is ready to receive JSON files in our standard schema.
  • Migration scripts: (likely one-time use)
    • remove-mongo-id [file]: MongoDB JSON dumps export internal IDs that clash with ES. This script removes them.
    • patch-mongo-dates [file]: MongoDB JSON dumps produce exports where all date-format variables are exported in a sub-variable called $date. This script fixes these so that they can be parsed by ES.

All these scripts require jq available.

Environment

To set the path to the server, set the environment variable ES_SERVER_URL to the server root (including path and authentication, if required).

To set these using mise, create a .mise.toml file containing:

[env]
ES_SERVER_URL = 'localhost:9200'

License

All scripts released under the GNU GPL v3. See the file COPYING.