|
|
# Mapping
|
|
|
Before you start you need to add the mapping to your elastic search instance
|
|
|
```bash
|
|
|
# portforwarding into the es cluster
|
|
|
kubectl port-forward service/elasticsearch-master 9200:9200
|
|
|
# generate the mapping
|
|
|
curl -X PUT "localhost:9200/geolinker-new/" -H 'Content-Type: application/json' -d'
|
|
|
{
|
|
|
"mappings": {
|
|
|
|
|
|
"properties": {
|
|
|
"id": {
|
|
|
"type": "keyword",
|
|
|
"ignore_above": 256
|
|
|
},
|
|
|
"provider": {
|
|
|
"type": "keyword",
|
|
|
"ignore_above": 256
|
|
|
},
|
|
|
"url": {
|
|
|
"type": "keyword",
|
|
|
"ignore_above": 512
|
|
|
},
|
|
|
"name": {
|
|
|
"type": "text",
|
|
|
"fields": {
|
|
|
"keyword": {
|
|
|
"type": "keyword",
|
|
|
"ignore_above": 256
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"alternative_name": {
|
|
|
"type": "text",
|
|
|
"fields": {
|
|
|
"keyword": {
|
|
|
"type": "keyword",
|
|
|
"ignore_above": 256
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"typology": {
|
|
|
"type": "keyword",
|
|
|
"ignore_above": 256
|
|
|
},
|
|
|
"country": {
|
|
|
"type": "keyword",
|
|
|
"ignore_above": 256
|
|
|
},
|
|
|
"location": {
|
|
|
"type": "geo_point"
|
|
|
},
|
|
|
"modification_date": {
|
|
|
"type": "date",
|
|
|
"ignore_malformed": true
|
|
|
},
|
|
|
"start": {
|
|
|
"type": "date",
|
|
|
"ignore_malformed": true
|
|
|
},
|
|
|
"end": {
|
|
|
"type": "date",
|
|
|
"ignore_malformed": true
|
|
|
}
|
|
|
}
|
|
|
|
|
|
},
|
|
|
"settings": {
|
|
|
"index": {
|
|
|
"number_of_shards": "5",
|
|
|
"number_of_replicas": "1"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
'
|
|
|
```
|
|
|
```bash
|
|
|
# create an index geloinker-new without mapping
|
|
|
curl -X PUT "localhost:9200/geolinker-new" -H 'Content-Type: application/json' -d'
|
|
|
{}
|
|
|
'
|
|
|
```
|
|
|
```bash
|
|
|
# delete an index geloinker-new
|
|
|
curl -X DELETE "localhost:9200/geolinker-new" -H 'Content-Type: application/json'
|
|
|
``` |