Skip to content

Instantly share code, notes, and snippets.

@danielef
Created January 12, 2018 16:09
Show Gist options
  • Save danielef/8f2d0744471ec8cf93c205fa6f7443e2 to your computer and use it in GitHub Desktop.
Save danielef/8f2d0744471ec8cf93c205fa6f7443e2 to your computer and use it in GitHub Desktop.
#Elasticsearch / Create an index with mapping
curl -XPUT -H "Content-Type: application/json" http://localhost:9200/my-index -d '
{
"mappings": {
"user": {
"properties": {
"name": { "type": "text" },
"user_name": { "type": "keyword" },
"email": { "type": "keyword" }
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment