This file contains 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
{"ok":true,"acknowledged":true} | |
{"ok":true,"acknowledged":true} | |
{"ok":true,"_index":"test","_type":"content","_id":"1","_version":1} | |
{"ok":true,"_index":"test","_type":"content","_id":"2","_version":1} | |
{"ok":true,"_shards":{"total":10,"successful":5,"failed":0}} | |
{ | |
"took" : 7, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 5, |
This file contains 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/twitter | |
curl -XPUT http://localhost:9200/twitter -d '{ | |
"settings" : { | |
"index" : { | |
"number_of_shards" : 1, | |
"number_of_replicas" : 1 | |
} | |
}, | |
"mappings" : { | |
"tweet" : { |
This file contains 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 all pins | |
curl -X DELETE "http://localhost:9200/pins" | |
echo | |
curl -XPUT 'http://localhost:9200/pins' | |
echo | |
# Create proper mapping | |
curl -XPUT 'http://localhost:9200/pins/pin/_mapping' -d ' | |
{ | |
"pin" : { | |
"properties" : { |
This file contains 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
#!/bin/bash | |
curl -XDELETE http://localhost:9200/test-orders | |
curl -XPUT http://localhost:9200/test-orders -d '{ | |
"mappings" : { | |
"copy_order_snapshot": { | |
"properties": { | |
"line_item_info": { | |
"dynamic": "true", | |
"properties": { | |
"m_product_details": { |
This file contains 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-index | |
echo | |
curl -XPUT http://localhost:9200/test-index -d '{ | |
"settings" : { | |
"index" : { | |
"number_of_shards" : 1, | |
"number_of_replicas" : 0 | |
} | |
}, | |
"mappings" : { |
This file contains 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/windowz' | |
echo | |
curl -XPUT 'http://localhost:9200/windowz' -d '{ | |
"mappings" : { | |
"message" : { | |
"properties" : { | |
"title" : { | |
"type" : "string", | |
"search_analyzer" : "str_search_analyzer", |
This file contains 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
<add><doc> | |
<field name="id">1</field> | |
<field name="message">foo and bar and something else</field> | |
</doc></add> |
This file contains 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
#!/bin/sh | |
curl -XDELETE http://localhost:9200/test-idx && echo | |
curl -XPUT http://localhost:9200/test-idx -d '{ | |
"settings" : { | |
"index" : { | |
"number_of_shards" : 1, | |
"number_of_replicas" : 0, | |
"analysis": { | |
"analyzer" : { | |
"standard_no_pos" : { |
This file contains 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
#!/bin/sh | |
curl -XDELETE "http://localhost:9200/test" | |
curl -XPUT "http://localhost:9200/test" -d '{ | |
"mappings" : { | |
"rec" : { | |
"_id" : {"store" : "yes"} | |
} | |
} | |
}' | |
curl -XPUT "http://localhost:9200/test/rec/1" -d '{ |
This file contains 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
#!/bin/sh | |
# Delete old version to make sure new settings are applied | |
curl -XDELETE "localhost:9200/prefix-test/" | |
echo | |
# Create a new index with custom path_hierarchy analyzer | |
# See http://www.elasticsearch.org/guide/reference/index-modules/analysis/pathhierarchy-tokenizer.html | |
curl -XPUT "localhost:9200/prefix-test" -d '{ | |
"settings": { | |
"analysis": { | |
"analyzer": { |