diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f587956 --- /dev/null +++ b/.gitignore @@ -0,0 +1,163 @@ + +# Created by https://www.gitignore.io/api/java,macos,jetbrains +# Edit at https://www.gitignore.io/?templates=java,macos,jetbrains + +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### JetBrains ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml +.idea/**/compiler.xml +.idea/**/encodings.xml +.idea/**/jarRepositories.xml + +.idea/**/leetcode-pro/ + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### JetBrains Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/**/sonarlint/ + +# SonarQube Plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator/ + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# End of https://www.gitignore.io/api/java,macos,jetbrains +/.idea/leetcode-pro/ diff --git a/mapping.json b/mapping.json deleted file mode 100644 index de72297..0000000 --- a/mapping.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "settings" : { - "number_of_shards" : 2, - "number_of_replicas" : 1, - "index": { - "analysis": { - "analyzer": { - "myCustomAnalyzer": { - "type": "custom", - "tokenizer": "myCustomTokenizer", - "filter": ["myCustomFilter1", "myCustomFilter2"], - "char_filter": ["myCustomCharFilter"] - } - }, - "tokenizer": { - "myCustomTokenizer": { - "type": "letter" - }, - "myCustomNGramTokenizer": { - "type" : "ngram", - "min_gram" : 2, - "max_gram" : 3 - } - - }, - "filter": { - "myCustomFilter1": { - "type": "lowercase" - }, - "myCustomFilter2": { - "type": "kstem" - } - }, - "char_filter": { - "myCustomCharFilter": { - "type": "mapping", - "mappings": ["ph=>f", " u => you ", "ES=>Elasticsearch"] - } - } - } - } - }, - "mappings" : { - "group" : { - "_source" : { - "enabled" : true - }, - "_all" : { - "enabled" : true - }, - "properties" : { - "organizer" : { "type" : "string" }, - "name" : { "type" : "string" }, - "description" : { - "type" : "string", - "term_vector": "with_positions_offsets" - }, - "created_on" : { - "type" : "date", - "format" : "yyyy-MM-dd" - }, - "tags" : { - "type" : "string", - "index" : "analyzed", - "fields": { - "verbatim" : { - "type" : "string", - "index" : "not_analyzed" - } - } - }, - "members" : { "type" : "string" }, - "location_group" : { "type" : "string" } - } - }, - "event" : { - "_source" : { - "enabled" : true - }, - "_all" : { - "enabled" : false - }, - "_parent" : { - "type" : "group" - }, - "properties" : { - "host" : { "type" : "string" }, - "title" : { "type" : "string" }, - "description" : { - "type" : "string", - "term_vector": "with_positions_offsets" - }, - "attendees" : { "type" : "string" }, - "date" : { - "type" : "date", - "format" : "date_hour_minute" - }, - "reviews" : { - "type" : "integer", - "null_value" : 0 - }, - "location_event": { - "type" : "object", - "properties" : { - "name" : { "type" : "string" }, - "geolocation" : { "type" : "geo_point" } - } - } - } - } - } -} diff --git a/mapping_event.json b/mapping_event.json new file mode 100644 index 0000000..48a98ce --- /dev/null +++ b/mapping_event.json @@ -0,0 +1,86 @@ +{ + "settings": { + "number_of_shards": 2, + "number_of_replicas": 1, + "index": { + "analysis": { + "analyzer": { + "myCustomAnalyzer": { + "type": "custom", + "tokenizer": "myCustomTokenizer", + "filter": [ + "myCustomFilter1", + "myCustomFilter2" + ], + "char_filter": [ + "myCustomCharFilter" + ] + } + }, + "tokenizer": { + "myCustomTokenizer": { + "type": "letter" + }, + "myCustomNGramTokenizer": { + "type": "ngram", + "min_gram": 2, + "max_gram": 3 + } + }, + "filter": { + "myCustomFilter1": { + "type": "lowercase" + }, + "myCustomFilter2": { + "type": "kstem" + } + }, + "char_filter": { + "myCustomCharFilter": { + "type": "mapping", + "mappings": [ + "ph=>f", + " u => you ", + "ES=>Elasticsearch" + ] + } + } + } + } + }, + "mappings": { + "properties": { + "host": { + "type": "text" + }, + "title": { + "type": "text" + }, + "description": { + "type": "text", + "term_vector": "with_positions_offsets" + }, + "attendees": { + "type": "text" + }, + "date": { + "type": "date", + "format": "date_hour_minute" + }, + "reviews": { + "type": "integer", + "null_value": 0 + }, + "location_event": { + "properties": { + "name": { + "type": "text" + }, + "geolocation": { + "type": "geo_point" + } + } + } + } + } +} \ No newline at end of file diff --git a/mapping_group.json b/mapping_group.json new file mode 100644 index 0000000..983bf91 --- /dev/null +++ b/mapping_group.json @@ -0,0 +1,90 @@ +{ + "settings": { + "number_of_shards": 2, + "number_of_replicas": 1, + "index": { + "analysis": { + "analyzer": { + "myCustomAnalyzer": { + "type": "custom", + "tokenizer": "myCustomTokenizer", + "filter": [ + "myCustomFilter1", + "myCustomFilter2" + ], + "char_filter": [ + "myCustomCharFilter" + ] + } + }, + "tokenizer": { + "myCustomTokenizer": { + "type": "letter" + }, + "myCustomNGramTokenizer": { + "type": "ngram", + "min_gram": 2, + "max_gram": 3 + } + }, + "filter": { + "myCustomFilter1": { + "type": "lowercase" + }, + "myCustomFilter2": { + "type": "kstem" + } + }, + "char_filter": { + "myCustomCharFilter": { + "type": "mapping", + "mappings": [ + "ph=>f", + " u => you ", + "ES=>Elasticsearch" + ] + } + } + } + } + }, + "mappings": { + "properties": { + "organizer": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword" + } + } + }, + "name": { + "type": "text" + }, + "description": { + "type": "text", + "term_vector": "with_positions_offsets" + }, + "created_on": { + "type": "date", + "format": "yyyy-MM-dd" + }, + "tags": { + "type": "text", + "index": "true", + "fields": { + "verbatim": { + "type": "text", + "index": "false" + } + } + }, + "members": { + "type": "text" + }, + "location_group": { + "type": "text" + } + } + } +} \ No newline at end of file diff --git a/populate.sh b/populate.sh index 6c4f202..69d1878 100755 --- a/populate.sh +++ b/populate.sh @@ -2,33 +2,35 @@ ADDRESS=$1 -if [ -z $ADDRESS ]; then +if [ -z "$ADDRESS" ]; then ADDRESS="localhost:9200" fi # Check that Elasticsearch is running -curl -s "http://$ADDRESS" 2>&1 > /dev/null +curl -H 'Content-Type: application/json' -s "http://$ADDRESS" &>/dev/null if [ $? != 0 ]; then - echo "Unable to contact Elasticsearch at $ADDRESS" - echo "Please ensure Elasticsearch is running and can be reached at http://$ADDRESS/" - exit -1 + echo "Unable to contact Elasticsearch at $ADDRESS" + echo "Please ensure Elasticsearch is running and can be reached at http://$ADDRESS/" + exit 1 fi echo "WARNING, this script will delete the 'get-together' and the 'myindex' indices and re-index all data!" echo "Press Control-C to cancel this operation." echo echo "Press [Enter] to continue." -read +read -r # Delete the old index, swallow failures if it doesn't exist -curl -s -XDELETE "$ADDRESS/get-together" > /dev/null +curl -H 'Content-Type: application/json' -s -XDELETE "$ADDRESS/get-together_group" >/dev/null +curl -H 'Content-Type: application/json' -s -XDELETE "$ADDRESS/get-together_event" >/dev/null -# Create the next index using mapping.json +# Create the next index using mapping_group.json echo "Creating 'get-together' index..." -curl -s -XPOST "$ADDRESS/get-together" -d@$(dirname $0)/mapping.json +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_group" -d@$(dirname $0)/mapping_group.json +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event" -d@$(dirname $0)/mapping_event.json # Wait for index to become yellow -curl -s "$ADDRESS/get-together/_health?wait_for_status=yellow&timeout=10s" > /dev/null +curl -H 'Content-Type: application/json' -s "$ADDRESS/get-together_group/_health?wait_for_status=yellow&timeout=10s" >/dev/null echo echo "Done creating 'get-together' index." @@ -36,7 +38,7 @@ echo echo "Indexing data..." echo "Indexing groups..." -curl -s -XPOST "$ADDRESS/get-together/group/1" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_group/_doc/1" -d'{ "name": "Denver Clojure", "organizer": ["Daniel", "Lee"], "description": "Group of Clojure enthusiasts from Denver who want to hack on code together and learn more about Clojure", @@ -47,7 +49,7 @@ curl -s -XPOST "$ADDRESS/get-together/group/1" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/group/2" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_group/_doc/2" -d'{ "name": "Elasticsearch Denver", "organizer": "Lee", "description": "Get together to learn more about using Elasticsearch, the applications and neat things you can do with ES!", @@ -58,7 +60,7 @@ curl -s -XPOST "$ADDRESS/get-together/group/2" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/group/3" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_group/_doc/3" -d'{ "name": "Elasticsearch San Francisco", "organizer": "Mik", "description": "Elasticsearch group for ES users of all knowledge levels", @@ -69,7 +71,7 @@ curl -s -XPOST "$ADDRESS/get-together/group/3" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/group/4" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_group/_doc/4" -d'{ "name": "Boulder/Denver big data get-together", "organizer": "Andy", "description": "Come learn and share your experience with nosql & big data technologies, no experience required", @@ -80,7 +82,7 @@ curl -s -XPOST "$ADDRESS/get-together/group/4" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/group/5" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_group/_doc/5" -d'{ "name": "Enterprise search London get-together", "organizer": "Tyler", "description": "Enterprise search get-togethers are an opportunity to get together with other people doing search.", @@ -95,7 +97,8 @@ echo "Done indexing groups." echo "Indexing events..." -curl -s -XPOST "$ADDRESS/get-together/event/100?parent=1" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/100" -d'{ + "group_id": "1", "host": ["Lee", "Troy"], "title": "Liberator and Immutant", "description": "We will discuss two different frameworks in Clojure for doing different things. Liberator is a ring-compatible web framework based on Erlang Webmachine. Immutant is an all-in-one enterprise application based on JBoss.", @@ -108,7 +111,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/100?parent=1" -d'{ "reviews": 4 }' echo -curl -s -XPOST "$ADDRESS/get-together/event/101?parent=1" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/101" -d'{ + "group_id": "1", "host": "Sean", "title": "Sunday, Surly Sunday", "description": "Sort out any setup issues and work on Surlybird issues. We can use the EC2 node as a bounce point for pairing.", @@ -121,7 +125,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/101?parent=1" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/102?parent=1" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/102" -d'{ + "group_id": "1", "host": "Daniel", "title": "10 Clojure coding techniques you should know, and project openbike", "description": "What are ten Clojure coding techniques that you wish everyone knew? We will also check on the status of Project Openbike.", @@ -135,7 +140,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/102?parent=1" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/103?parent=2" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/103" -d'{ + "group_id": "2", "host": "Lee", "title": "Introduction to Elasticsearch", "description": "An introduction to ES and each other. We can meet and greet and I will present on some Elasticsearch basics and how we use it.", @@ -149,7 +155,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/103?parent=2" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/104?parent=2" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/104" -d'{ + "group_id": "2", "host": "Lee", "title": "Queries and Filters", "description": "A get together to talk about different ways to query Elasticsearch, what works best for different kinds of applications.", @@ -163,7 +170,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/104?parent=2" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/105?parent=2" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/105" -d'{ + "group_id": "2", "host": "Lee", "title": "Elasticsearch and Logstash", "description": "We can get together and talk about Logstash - http://logstash.net with a sneak peek at Kibana", @@ -177,7 +185,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/105?parent=2" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/106?parent=3" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/106" -d'{ + "group_id": "3", "host": "Mik", "title": "Social management and monitoring tools", "description": "Shay Banon will be there to answer questions and we can talk about management tools.", @@ -191,7 +200,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/106?parent=3" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/107?parent=3" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/107" -d'{ + "group_id": "3", "host": "Mik", "title": "Logging and Elasticsearch", "description": "Get a deep dive for what Elasticsearch is and how it can be used for logging with Logstash as well as Kibana!", @@ -205,7 +215,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/107?parent=3" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/108?parent=3" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/108" -d'{ + "group_id": "3", "host": "Elyse", "title": "Piggyback on Elasticsearch training in San Francisco", "description": "We can piggyback on training by Elasticsearch to have some Q&A time with the ES devs", @@ -219,7 +230,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/108?parent=3" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/109?parent=4" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/109" -d'{ + "group_id": "4", "host": "Andy", "title": "Hortonworks, the future of Hadoop and big data", "description": "Presentation on the work that hortonworks is doing on Hadoop", @@ -233,7 +245,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/109?parent=4" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/110?parent=4" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/110" -d'{ + "group_id": "4", "host": "Andy", "title": "Big Data and the cloud at Microsoft", "description": "Discussion about the Microsoft Azure cloud and HDInsight.", @@ -247,7 +260,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/110?parent=4" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/111?parent=4" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/111" -d'{ + "group_id": "4", "host": "Andy", "title": "Moving Hadoop to the mainstream", "description": "Come hear about how Hadoop is moving to the main stream", @@ -261,7 +275,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/111?parent=4" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/112?parent=5" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/112" -d'{ + "group_id": "5", "host": "Dave Nolan", "title": "real-time Elasticsearch", "description": "We will discuss using Elasticsearch to index data in real time", @@ -275,7 +290,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/112?parent=5" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/113?parent=5" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/113" -d'{ + "group_id": "5", "host": "Dave", "title": "Elasticsearch at Rangespan and Exonar", "description": "Representatives from Rangespan and Exonar will come and discuss how they use Elasticsearch", @@ -289,7 +305,8 @@ curl -s -XPOST "$ADDRESS/get-together/event/113?parent=5" -d'{ }' echo -curl -s -XPOST "$ADDRESS/get-together/event/114?parent=5" -d'{ +curl -H 'Content-Type: application/json' -s -XPUT "$ADDRESS/get-together_event/_doc/114" -d'{ + "group_id": "5", "host": "Yann", "title": "Using Hadoop with Elasticsearch", "description": "We will walk through using Hadoop with Elasticsearch for big data crunching!", @@ -306,7 +323,7 @@ echo echo "Done indexing events." # Refresh so data is available -curl -s -XPOST "$ADDRESS/get-together/_refresh" +curl -H 'Content-Type: application/json' -s -XGET "$ADDRESS/get-together_event/_refresh" echo echo "Done indexing data." @@ -314,52 +331,53 @@ echo echo echo "Creating Templates." -curl -s -XPUT "http://$ADDRESS/_template/logging_index_all" -d'{ - "template" : "logstash-09-*", - "order" : 1, - "settings" : { - "number_of_shards" : 2, - "number_of_replicas" : 1 - }, - "mappings" : { - "date" : { "store": false } - }, - "alias" : { "november" : {} } +curl -H 'Content-Type: application/json' -s -XPUT "http://$ADDRESS/_template/logging_index_all" -d'{ + "index_patterns": "logstash-09-*", + "order": 1, + "settings": { + "number_of_shards": 2, + "number_of_replicas": 1 + }, + "mappings": { + "properties": { + "date": { + "type": "date", + "store": false + } + } + }, + "aliases": { + "november": {} + } }' echo -curl -s -XPUT "http://$ADDRESS/_template/logging_index" -d '{ - "template" : "logstash-*", +curl -H 'Content-Type: application/json' -s -XPUT "http://$ADDRESS/_template/logging_index" -d '{ + "index_patterns" : "logstash-*", "order" : 0, "settings" : { "number_of_shards" : 2, "number_of_replicas" : 1 }, "mappings" : { - "date" : { "store": true } + "properties": { + "date": { + "type": "date", + "store": false + } + } } }' echo echo "Done Creating Templates." - echo echo "Adding Dynamic Mapping" -curl -s -XDELETE "http://$ADDRESS/myindex" > /dev/null -curl -s -XPUT "http://$ADDRESS/myindex" -d' +curl -H 'Content-Type: application/json' -s -XDELETE "http://$ADDRESS/myindex" >/dev/null +curl -H 'Content-Type: application/json' -s -XPUT "http://$ADDRESS/myindex" -d' { "mappings" : { - "my_type" : { - "dynamic_templates" : [{ - "UUID" : { - "match" : "*_guid", - "match_mapping_type" : "string", - "mapping" : { - "type" : "string", - "index" : "not_analyzed" - } - } - }] + "properties" : { } } }' @@ -368,53 +386,50 @@ echo "Done Adding Dynamic Mapping" echo echo "Adding Aliases" -curl -s -XDELETE "http://$ADDRESS/november_2014_invoices" > /dev/null -curl -s -XDELETE "http://$ADDRESS/december_2014_invoices" > /dev/null -curl -s -XPOST "http://$ADDRESS/november_2014_invoices" -d'{}' +curl -H 'Content-Type: application/json' -s -XDELETE "http://$ADDRESS/november_2014_invoices" >/dev/null +curl -H 'Content-Type: application/json' -s -XDELETE "http://$ADDRESS/december_2014_invoices" >/dev/null +curl -H 'Content-Type: application/json' -s -XPUT "http://$ADDRESS/november_2014_invoices" -d'{}' echo -curl -s -XPOST "http://$ADDRESS/december_2014_invoices" -d' +curl -H 'Content-Type: application/json' -s -XPUT "http://$ADDRESS/december_2014_invoices" -d' { - "mappings" : - { - "invoice" : - { - "properties" : - { - "revenue" : { "type" : "integer" } - } + "mappings" : { + "properties" : { + "revenue" : { "type" : "integer" } } } }' echo -curl -s -XPOST "http://$ADDRESS/_aliases" -d' +curl -H 'Content-Type: application/json' -s -XPOST "http://$ADDRESS/_aliases" -d' { - "actions" : [ - { - "add" : - { - "index" : "november_2014_invoices", - "alias" : "2014_invoices" - }, - "add" : - { - "index" : "december_2014_invoices", - "alias" : "2014_invoices" - }, - "remove" : - { - "index" : "myindex", - "alias" : "december_2014_invoices" - } - } + "actions": [ + { + "add": { + "index": "november_2014_invoices", + "alias": "2014_invoices" + } + }, + { + "add": { + "index": "december_2014_invoices", + "alias": "2014_invoices" + } + }, + { + "remove": { + "index": "myindex", + "alias": "december_2014_invoices" + } + } ] }' + echo echo "Done Adding Aliases" echo "Adding Filter Alias" -curl -s -XPOST "http://$ADDRESS/_aliases" -d ' +curl -H 'Content-Type: application/json' -s -XPOST "http://$ADDRESS/_aliases" -d ' { "actions" : [ { @@ -441,7 +456,7 @@ echo "Done Adding Filter Alias" echo echo "Adding Routing Alias" -curl -s -XPOST "http://$ADDRESS/_aliases" -d ' +curl -H 'Content-Type: application/json' -s -XPOST "http://$ADDRESS/_aliases" -d ' { "actions" : [ {