Skip to content

Instantly share code, notes, and snippets.

@mz1991 mz1991/commands.txt
Created Apr 1, 2017

Embed
What would you like to do?
Elastic Graph Demo commands
// Create the new index
curl -XPUT 'http://elasticsearchEndPoint:9200/chicagoemployees?pretty' -H 'Content-Type: application/json' -d'
{
"settings" : {
"index" : {
"number_of_shards" : 3,
"number_of_replicas" : 2
}
}
}
'
// Put the mapping
curl -XPUT http://elasticsearchEndPoint:9200/chicagoemployees -d '
{
"mappings" : {
"employee" : {
"properties" : {
"name" : {"type": "string", "index" : "not_analyzed" },
"surname" : {"type": "string", "index" : "not_analyzed" },
"position" : {"type": "string", "index" : "not_analyzed" },
"department" : {"type": "string", "index" : "not_analyzed" },
"sex" : {"type": "string", "index" : "not_analyzed" },
"income_class" : {"type": "string", "index" : "not_analyzed" },
"annual_salary" : { "type" : "float" }
}
}
}
}
';
// Index the documents
curl -XPUT elasticsearchEndPoint:9200/_bulk --data-binary @chicagoemployees.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.