Last active
March 10, 2021 20:02
-
-
Save CarlosLannister/8a1c99adf6b67313a54b97c1885ec82f to your computer and use it in GitHub Desktop.
Create elasticsearch index with mapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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