Core Elasticsearch App
Elasticsearch utils for the curator core project.
Quick start
1. Add “core_elasticsearch_app” to your INSTALLED_APPS setting
INSTALLED_APPS = [
...
'core_elasticsearch_app',
]
The package should be placed above core_explore_keyword_app in the INSTALLED_APPS to enable autocomplete powered by elasticsearch.
2. Include the core_elasticsearch_app URLconf in your project urls.py
re_path(r'^elasticsearch/', include('core_elasticsearch_app.urls')),
3. Deploy an instance of Elasticsearch
Recommended version: 7.14.1 See https://github.com/usnistgov/cdcs-docker#elasticsearch for help with Elasticsearch deployment.
4. Configure what should be indexed in Elasticsearch
It is recommended to configure the mapping between the CDCS templates and the Elasticsearch indices before starting to insert data, so that data can be indexed as soon as they are published in the CDCS. For that, set the following setting:
ELASTICSEARCH_AUTO_INDEX = True
Then, configure the mapping between the XSD templates and the Elasticsearch indices. Documents stored in Elasticsearch have a common structure. They are composed of a data_id, a title and a description field. A mapping can be defined to tell where in the XML data the values for the title and for the description of a resource can be found. Below is an example to set this mapping via REST, for a given template:
import requests
payload = {
"template": "5f43ba192b8fd5c092e30e62",
"title_path": "Resource/identity/title",
"description_paths": ["Resource/content/description", "Resource/content/subject"],
}
requests.post(
SERVER_URI + "/elasticsearch/rest/elasticsearch_template/", data=payload, auth=(USER, PASSWORD)
)
Metadata
Release files for core-elasticsearch-app 2.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| core_elasticsearch_app-2.5.0.tar.gz | 19.1 kB | Without provenance | Details for core_elasticsearch_app-2.5.0.tar.gz |
Release files / core_elasticsearch_app-2.5.0.tar.gz
| Download URL | core_elasticsearch_app-2.5.0.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
56f5698c19c4f65e6d2fd0373428fb5695a8202af11ed4758d92e27b704893bf
|
|
BLAKE2b-256 checksum How to use checksums |
6560bfd888cede041176d994f9d26225fb9ebd1bebf0dbecf9eea7d6914576ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.16
|
Security for core-elasticsearch-app 2.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.