Skip to content

Instantly share code, notes, and snippets.

@CarlosLannister
Last active March 10, 2021 20:02
Show Gist options
  • Save CarlosLannister/8a1c99adf6b67313a54b97c1885ec82f to your computer and use it in GitHub Desktop.
Save CarlosLannister/8a1c99adf6b67313a54b97c1885ec82f to your computer and use it in GitHub Desktop.
Create elasticsearch index with mapping
curl --user elastic:medium -X PUT "localhost:9200/twitter?pretty" -H 'Content-Type: application/json' -d'
{
"settings": {
"number_of_shards": 2,
"number_of_replicas": 3
},
"mappings": {
"properties": {
"content": {
"type": "text"
},
"user_name": {
"type": "keyword"
},
"tweeted_at": {
"type": "date"
}
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment