From fad0705e3049bd1c3a74593e9adbfbfadbd82944 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 4 May 2016 10:23:49 -0400 Subject: [PATCH] [docs] Modernize README.textile * camel_case all the things * `?pretty` all the things (we tell people to do this in bug reports) Closes #18136 --- README.textile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/README.textile b/README.textile index 5c75844b108..e48495a5524 100644 --- a/README.textile +++ b/README.textile @@ -50,19 +50,19 @@ h3. Indexing Let's try and index some twitter like information. First, let's create a twitter user, and add some tweets (the @twitter@ index will be created automatically):
-curl -XPUT 'http://localhost:9200/twitter/user/kimchy' -d '{ "name" : "Shay Banon" }'
+curl -XPUT 'http://localhost:9200/twitter/user/kimchy?pretty' -d '{ "name" : "Shay Banon" }'
 
-curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '
+curl -XPUT 'http://localhost:9200/twitter/tweet/1?pretty' -d '
 {
     "user": "kimchy",
-    "postDate": "2009-11-15T13:12:00",
+    "post_date": "2009-11-15T13:12:00",
     "message": "Trying out Elasticsearch, so far so good?"
 }'
 
-curl -XPUT 'http://localhost:9200/twitter/tweet/2' -d '
+curl -XPUT 'http://localhost:9200/twitter/tweet/2?pretty' -d '
 {
     "user": "kimchy",
-    "postDate": "2009-11-15T14:12:12",
+    "post_date": "2009-11-15T14:12:12",
     "message": "Another tweet, will it be indexed?"
 }'
 
@@ -101,7 +101,7 @@ Just for kicks, let's get all the documents stored (we should see the user as we curl -XGET 'http://localhost:9200/twitter/_search?pretty=true' -d ' { "query" : { - "matchAll" : {} + "match_all" : {} } }' @@ -113,7 +113,7 @@ curl -XGET 'http://localhost:9200/twitter/_search?pretty=true' -d ' { "query" : { "range" : { - "postDate" : { "from" : "2009-11-15T13:00:00", "to" : "2009-11-15T14:00:00" } + "post_date" : { "from" : "2009-11-15T13:00:00", "to" : "2009-11-15T14:00:00" } } } }' @@ -130,19 +130,19 @@ Elasticsearch supports multiple indices, as well as multiple types per index. In Another way to define our simple twitter system is to have a different index per user (note, though that each index has an overhead). Here is the indexing curl's in this case:
-curl -XPUT 'http://localhost:9200/kimchy/info/1' -d '{ "name" : "Shay Banon" }'
+curl -XPUT 'http://localhost:9200/kimchy/info/1?pretty' -d '{ "name" : "Shay Banon" }'
 
-curl -XPUT 'http://localhost:9200/kimchy/tweet/1' -d '
+curl -XPUT 'http://localhost:9200/kimchy/tweet/1?pretty' -d '
 {
     "user": "kimchy",
-    "postDate": "2009-11-15T13:12:00",
+    "post_date": "2009-11-15T13:12:00",
     "message": "Trying out Elasticsearch, so far so good?"
 }'
 
-curl -XPUT 'http://localhost:9200/kimchy/tweet/2' -d '
+curl -XPUT 'http://localhost:9200/kimchy/tweet/2?pretty' -d '
 {
     "user": "kimchy",
-    "postDate": "2009-11-15T14:12:12",
+    "post_date": "2009-11-15T14:12:12",
     "message": "Another tweet, will it be indexed?"
 }'
 
@@ -152,11 +152,11 @@ The above will index information into the @kimchy@ index, with two types, @info@ Complete control on the index level is allowed. As an example, in the above case, we would want to change from the default 5 shards with 1 replica per index, to only 1 shard with 1 replica per index (== per twitter user). Here is how this can be done (the configuration can be in yaml as well):
-curl -XPUT http://localhost:9200/another_user/ -d '
+curl -XPUT http://localhost:9200/another_user?pretty -d '
 {
     "index" : {
-        "numberOfShards" : 1,
-        "numberOfReplicas" : 1
+        "number_of_shards" : 1,
+        "number_of_replicas" : 1
     }
 }'
 
@@ -168,7 +168,7 @@ index (twitter user), for example: curl -XGET 'http://localhost:9200/kimchy,another_user/_search?pretty=true' -d ' { "query" : { - "matchAll" : {} + "match_all" : {} } }' @@ -179,7 +179,7 @@ Or on all the indices: curl -XGET 'http://localhost:9200/_search?pretty=true' -d ' { "query" : { - "matchAll" : {} + "match_all" : {} } }'