165246aaba759cd93fa94c2cc1a71d0e6d0d6ed4
[ccsdk/features.git] /
1 #!/bin/sh
2
3 curl -XDELETE 'http://localhost:9200/twitter'
4 echo
5 curl -XPUT 'http://localhost:9200/twitter'
6 echo
7 curl -XPUT 'http://localhost:9200/twitter/_mapping' -d '{
8         "tweet": {
9                 "date_formats": ["date_time", "yyyyMMddHHmmss", "yyyyMMddHHmmssSSS"],
10                 "properties" : {
11                         "user" : { "type" : "string", "index" : "not_analyzed" },
12                         "message" : { "type" : "string" },
13                         "postDate" : { "type" : "date" },
14                         "srcAddr" : { "type" : "ip" },
15                         "priority" : { "type" : "integer", null_value: 1 },
16                         "rank" : { "type" : "float", null_value: 1.0 },
17                         "loc" : { "type": "geo_point" }
18                 }
19         }
20 }'
21 echo
22 curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{
23         "user" : "mobz",
24         "message" : "developing a tool to search with",
25         "postDate" : "20110220100330",
26         "srcAddr" : "203.19.74.11",
27         "loc" : "-37.86,144.90"
28 }'
29 echo
30 curl -XPUT 'http://localhost:9200/twitter/tweet/2' -d '{
31         "user" : "mobz",
32         "message" : "you know, for elastic search",
33         "postDate" : "20110220095900",
34         "srcAddr" : "203.19.74.11",
35         "loc" : "-37.86,144.90"
36 }'
37 echo
38 curl -XPUT 'http://localhost:9200/twitter/tweet/3' -d '{
39         "user" : "mobz",
40         "message" : "lets take some matilda bay",
41         "postDate" : "20110221171330",
42         "srcAddr" : "203.19.74.11",
43         "loc" : "-37.86,144.90"
44 }'
45 echo