Skip to content

Instantly share code, notes, and snippets.

@DarkcoderSe
Created May 12, 2021 05:50
Show Gist options
  • Save DarkcoderSe/a58ded3344fd4993f94a969ac23a835f to your computer and use it in GitHub Desktop.
Save DarkcoderSe/a58ded3344fd4993f94a969ac23a835f to your computer and use it in GitHub Desktop.
Creation of ElasticSearch template mapping using curl
curl -X PUT "localhost:9200/_template/templateName?pretty" -H 'Content-Type: application/json' -d'
{
"index_patterns": ["indexA*", "indexB*"],
"settings": {
"number_of_shards": 1
},
"mappings": {
"_source": {
"enabled": false
},
"properties": {
"id": {
"type": "text"
},
"facility_id": {
"type": "text"
},
"code": {
"type": "text"
},
"description": {
"type": "text"
},
"price": {
"type": "text"
},
"original_code": {
"type": "text"
},
"facility_name": {
"type": "text"
},
"address": {
"type": "text"
},
"city": {
"type": "text"
},
"state": {
"type": "text"
},
"zip_code": {
"type": "text"
},
"phone_number": {
"type": "text"
},
"location": {
"type": "geo_point"
}
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment