Thursday, April 9, 2015

1:  root@es-master1z:~# curl -XGET 'http://localhost:9200/gold*/_mapping?pretty'

curl -XPUT 'http://localhost:9200/soci*/tweets/_mapping' -d '{"_ttl": {"enabled": true, "default": 5000}}'


2: curl -XPUT 'http://localhost:9200/smarttvsysinfo/'

3:




curl -XPUT 'http://localhost:9200/_template/template_1' -d '
{
    "template" : "gold*",
    "settings" : {
        "analysis" : {
            "filter" : {
                "tweet_filter" : {
                    "type" : "word_delimiter",
                    "split_on_case_change":"false",
                    "split_on_numerics":"false",
                    "type_table": ["# => ALPHA", "@ => ALPHA", "_ => ALPHA"]
                }
            },
            "analyzer" : {
                "tweet_analyzer" : {
                    "type" : "custom",
                    "tokenizer" : "whitespace",
                    "filter" : ["lowercase", "tweet_filter"]
                }
            }
        }
    },
   "mappings" : {
        "_default_" : {
            "_ttl" : { "enabled" : true, "default": 180002 } ,
            "properties" : {
                "text" : {
                    "type" : "string",
                    "analyzer" : "tweet_analyzer"
                },
                "retweeted_status" : {
                    "properties" : {
                        "text" : {
                            "type" : "string",
                            "analyzer" : "tweet_analyzer"
                        }
                    }
                },
                "user" : {
                    "properties" : {
                        "screen_name" : {
                            "type" : "string",
                            "analyzer" : "tweet_analyzer"
                        }
                    }
                },
                "in_reply_to_screen_name" : {
                    "type" : "string",
                    "analyzer" : "tweet_analyzer"
                }
            }
        }

    }
}
'