Commit d08af2cd authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Remove mappings. Moved to appropriate place.

parent 176734f8
##OAI Index Field Description
### id
document identifier
### document
complete record delivered by the OAI API - as starter for memobase only Europeana EDM format
### format
label for the format stored in the document field (for europeana edm)
could be used for oai set purposes
### published
[true|false]
indicator if document should be delivered (harvested) by the OAI API
### recordset
the data the document is part of - (Bestand) don't know if we use this for the API at the moment
### institution
institution the data belongs to
### lastUpdatedDate
timestamp necessary for harvesting (from | until)
## Elasticsearch Mapping Templates
These mapping templates are used by elasticsearch to create the search & utility indices of
the Memobase service.
These templates are used to ensure that the index is always built consistently.
These mappings can be added via the Kibana Console or directly via curl. Each template is added
under a specific name:
* `documents.template.json` -> `documents-template`
* `institutions.template.json` -> `institutions-template`
* `record-sets.template.json` -> `record-sets-template`
* `reports.template.json` -> `reports-template`
### Kibana Console
Update a template:
```
PUT _template/<nameOfTemplate>-template
<copy content of json file>
```
### CURL
Create a tunnel first:
```bash
ssh -L 8080:mb-es1:8080 swissbib@mb-es1.memobase.unibas.ch
```
#### Documents (Records & Instantiations)
```bash
curl -X PUT "localhost:8080/_template/documents-template" -H 'Content-Type: application/json' -d @documents.template.json
```
#### Institutions
```bash
curl -X PUT "localhost:8080/_template/institutions-template" -H 'Content-Type: application/json' -d @institutions.template.json
```
#### Record Sets
```bash
curl -X PUT "localhost:8080/_template/record-sets-template" -H 'Content-Type: application/json' -d @record-sets.template.json
```
#### Reports
```bash
curl -X PUT "localhost:8080/_template/reports-template" -H 'Content-Type: application/json' -d @reports.template.json
```
#### RICO to EDM
```bash
curl -X PUT "localhost:8080/_template/oai-template" -H 'Content-Type: application/json' -d @rico2edm.template.json
```
\ No newline at end of file
{
"index_patterns": [
"documents*"
],
"settings": {
"number_of_replicas": 1,
"number_of_shards": 3
},
"mappings": {
"date_detection": false,
"dynamic_templates": [
{
"relation_as_keyword": {
"path_match": "*.relation",
"mapping": {
"properties": {
"de": {
"type": "keyword"
},
"fr": {
"type": "keyword"
},
"it": {
"type": "keyword"
},
"un": {
"type": "keyword"
}
}
}
}
},
{
"facet_as_keyword": {
"path_match": "*.facet",
"mapping": {
"type": "keyword"
}
}
},
{
"sort_as_keyword": {
"path_match": "*.sort",
"mapping": {
"type": "keyword"
}
}
},
{
"filter_as_keyword": {
"path_match": "*.filter",
"mapping": {
"type": "keyword"
}
}
},
{
"german_fields": {
"path_match": "*.de",
"mapping": {
"type": "text",
"analyzer": "german",
"fields": {
"filter": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
{
"french_fields": {
"path_match": "*.fr",
"mapping": {
"type": "text",
"analyzer": "french",
"fields": {
"filter": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
{
"italian_fields": {
"path_match": "*.it",
"mapping": {
"type": "text",
"analyzer": "italian",
"fields": {
"filter": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
{
"unknown_language_fields": {
"path_match": "*.un",
"mapping": {
"type": "text",
"fields": {
"filter": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
{
"strings_as_text": {
"match_mapping_type": "string",
"mapping": {
"type": "text"
}
}
}
],
"properties": {
"id": {
"type": "keyword"
},
"sourceID": {
"type": "keyword"
},
"callNumber": {
"type": "keyword"
},
"usageDigital": {
"type": "keyword"
},
"usagePhysical": {
"type": "keyword"
},
"locator": {
"type": "keyword"
},
"durationPhysical": {
"type": "keyword"
},
"durationDigital": {
"type": "keyword"
},
"published": {
"type": "boolean"
},
"suggest": {
"properties": {
"title": {
"type": "completion"
},
"seriesTitle": {
"type": "completion"
},
"broadcastTitle": {
"type": "completion"
},
"keywords": {
"type": "completion"
}
}
}
}
}
}
{
"index_patterns": [
"institutions*"
],
"settings": {
"number_of_replicas": 1,
"number_of_shards": 3
},
"mappings": {
"date_detection": false,
"dynamic_templates": [
{
"filter_as_keyword": {
"path_match": "*.filter",
"mapping": {
"type": "keyword"
}
}
},
{
"facet_as_keyword": {
"path_match": "*.facet",
"mapping": {
"type": "keyword"
}
}
},
{
"add_sort_field_to_name": {
"path_match": "name.*",
"mapping": {
"fields": {
"sort": {
"type": "keyword"
}
}
}
}
},
{
"german_fields": {
"path_match": "*.de",
"mapping": {
"type": "text",
"analyzer": "german",
"fields": {
"filter": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
{
"french_fields": {
"path_match": "*.fr",
"mapping": {
"type": "text",
"analyzer": "french",
"fields": {
"filter": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
{
"italian_fields": {
"path_match": "*.it",
"mapping": {
"type": "text",
"analyzer": "italian",
"fields": {
"filter": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
{
"unknown_language_fields": {
"path_match": "*.un",
"mapping": {
"type": "text",
"fields": {
"filter": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
],
"properties": {
"id": {
"type": "keyword"
},
"isPublished": {
"type": "boolean"
},
"keyVisualLink": {
"type": "keyword"
},
"address": {
"type": "text"
},
"postalCodes": {
"type": "text"
},
"numberOfDocuments": {
"type": "long"
},
"numberOfRecordSets": {
"type": "long"
},
"published": {
"type": "boolean"
},
"teaserColor": {
"type": "keyword"
},
"teaserColorComputed": {
"type": "keyword"
},
"lastUpdatedDate": {
"type": "keyword",
"fields": {
"sort": {
"type": "date"
}
}
}
}
}
}
\ No newline at end of file
{
"index_patterns": [
"record-sets*"
],
"settings": {
"number_of_replicas": 1,
"number_of_shards": 3
},
"mappings": {
"date_detection": false,
"dynamic_templates": [
{
"filter_as_keyword": {
"path_match": "*.filter",
"mapping": {
"type": "keyword"
}
}
},
{
"facet_as_keyword": {
"path_match": "*.facet",
"mapping": {
"type": "keyword"
}
}
},
{
"add_sort_field_to_name": {
"path_match": "name.*",
"mapping": {
"fields": {
"sort": {
"type": "keyword"
}
}
}
}
},
{
"german_fields": {
"path_match": "*.de",
"mapping": {
"type": "text",
"analyzer": "german",
"fields": {
"filter": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
{
"french_fields": {
"path_match": "*.fr",
"mapping": {
"type": "text",
"analyzer": "french",
"fields": {
"filter": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
{
"italian_fields": {
"path_match": "*.it",
"mapping": {
"type": "text",
"analyzer": "italian",
"fields": {
"filter": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
{
"unknown_language_fields": {
"path_match": "*.un",
"mapping": {
"type": "text",
"fields": {
"filter": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
],
"properties": {
"id": {
"type": "keyword"
},
"published": {
"type": "boolean"
},
"keyVisualLink": {
"type": "keyword"
},
"supportedByMemoriav": {
"type": "boolean"
},
"periodOfTimeAsYear": {
"type": "integer_range"
},
"periodOfTimeAsYearFrom": {
"type": "keyword"
},
"periodOfTimeAsYearTo": {
"type": "keyword"
},
"lastUpdatedDate": {
"type": "keyword",
"fields": {
"sort": {
"type": "date"
}
}
}
}
}
}
\ No newline at end of file
{
"index_patterns": [
"reports-*"
],
"settings": {
"number_of_replicas": 1,
"number_of_shards": 3
}
}
\ No newline at end of file
{
"index_patterns": [
"oai*"
],
"settings": {
"number_of_replicas": 1,
"number_of_shards": 3
},
"mappings": {
"date_detection": false,
"properties": {
"id": {
"type": "keyword"
},
"document": {
"type": "keyword",
"index": false
},
"format": {
"type": "keyword"
},
"published": {
"type": "boolean"
},
"recordset": {
"type": "keyword"
},
"lastUpdatedDate": {
"type": "keyword",
"fields": {
"sort": {
"type": "date"
}
}
}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment