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 -XDELETE "http://localhost:9200/test?pretty" | |
curl -XPOST "http://localhost:9200/test?pretty" -d '{ | |
"settings": { | |
"index": { | |
"number_of_shards": 1, | |
"number_of_replicas": 0, | |
"analysis":{ | |
"analyzer":{ | |
"suggest":{ | |
"type": "custom", |
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
echo "Deleting old ElasticSearch index..." | |
curl -XDELETE 'localhost:9200/arrtest'; echo | |
echo "Creating new ElasticSearch index..." | |
curl -XPUT 'localhost:9200/arrtest/?pretty=1' -d ' | |
{ | |
"mappings" : { | |
"cust2" : { | |
"properties" : { | |
"firstName" : { |
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
# Delete index | |
curl -XDELETE 'http://localhost:9200/pms/' ; echo | |
curl -XPUT 'http://localhost:9200/pms/' -d '{ | |
"analysis" : { | |
"analyzer" : { | |
"auto_complete" : { | |
"type" : "custom", | |
"tokenizer" : "custom_edgeNGram", | |
"filter" : ["lowercase","custom_ngram"] |
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 -XPUT http://localhost:9200/test/ticket/_mappinq? -d '{ | |
"ticket" : { | |
"properties" : { | |
"DOC_CREATION_DATE" : { | |
"type" : "date", | |
"format" : "yyyy-MM-dd || yyyy-MM-dd HH:mm:ss", | |
"locale" : "FR" | |
} | |
} | |
} |
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 -XDELETE http://localhost:9200/test; echo | |
curl -XPUT http://localhost:9200/test; echo | |
curl -XPUT http://localhost:9200/test/ticket/_mapping -d '{ | |
"ticket":{ | |
"properties":{ | |
"DOC_CREATION_DATE":{ | |
"type":"date", | |
"format":"dateOptionalTime" | |
}, |
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 -XGET 'http://localhost:9200/_nodes/stats?all=true&pretty=true' > nodes.stats.json | |
node stats_converter.js | |
# Or | |
node stats_converter.js filename |
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
echo "clean index" | |
curl -XDELETE 'http://localhost:9200/test?pretty' ; echo | |
echo "PUT Tweet" | |
curl -XPUT 'http://localhost:9200/test/tweet/1?pretty' -d ' | |
{ | |
"myfield": "Hello world" | |
} | |
' ; echo | |
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
echo "clean index" | |
curl -XDELETE 'http://localhost:9200/twitter?pretty' ; echo | |
echo "PUT Tweet" | |
curl -XPUT 'http://localhost:9200/twitter/tweet/1?ttl=1h&pretty' -d ' | |
{ | |
"created_at": "Mon May 13 19:59:27 +0000 2013" | |
} | |
' ; echo |
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
// app.js | |
angular.module('cs_demo', [ | |
'controllers', | |
'elasticjs.service', | |
'ui.bootstrap' | |
]); |
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
# Delete the index `testindex` | |
curl -XDELETE 'http://localhost:9200/testindex' | |
# Create the index `testindex` | |
curl -XPUT 'http://localhost:9200/testindex' -d '{ | |
"settings" : { | |
"index" : { | |
"number_of_shards" : 1, | |
"number_of_replicas" : 0 | |
} |