- python3 (≥ 3.6)
- elasticssearch
- elasticssearch_dsl
Elasticsearch DSL is a high-level library whose aim is to help with writing and running queries against Elasticsearch. It is built on top of the official low-level client (elasticsearch-py).
Assuming the Agent repository has been cloned to $AGENTDIR
, install the Agent
and its remaining package dependencies with:
pip3 install $AGENTDIR
Run the following commands to create an elasticsearch instance for the Agent:
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
sudo apt-get update && sudo apt-get install elasticsearch
sudo service elasticsearch start
Go to http://localhost:9200 to check that elasticsearch is running. Depending
on your system, you might need to set START_DAEMON=true
in /etc/default/elasticsearch
(and restart the service after changing the config).
Add an index where records will be stored
- index: where the new records will be stored
- metadata_json: a template records used to define the metadata structure
Delete an exiting index
- index: name of index to be created
Return selected records in a 'SAEON JSON DataCite' format
- index: where the new records will be found
- field/value pairs: provide any number of fields with the search value
- fields: limit output to only fields given in this comma separated list
- from: from date
- to: to date
- sort: sort results by the given field in ascending order
- sortorder: asc or desc
- start: position of the first record returned, default is 1
- size: number of results, default is 100
- encloses: return objects that lay completely within given rectangle specified as postions top left and bottom right
- overlaps: return objects that lay partially within given rectangle specified as postions top left and bottom right
- includes: return objects that contain the given rectangle specified as postions top left and bottom right
Add a record to a collection
- index: where the new records will be stored
- record_id: unique ID of the record
- metadata_json: json dict in 'SAEON JSON DataCite' format
- collection: optional collection name
- organization: optional name of organization
- infrastructures: optional list of infrastructures
Delete a given record
- index: where records are stored
- record_id: record identifier to be deleted
- force: optional to force deletion of duplicated records
Delete all records
- index: where records are stored
Return all known facets
- index: where records are stored
- facets (optional): comma separated list of facets
See more details here (http://www.openarchives.org/pmh)
- Identity
- ListMetadataFormats
- ListIdentifiers
- ListRecords
- GetRecord