aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators
diff options
context:
space:
mode:
authorHerbert Eiselt <herbert.eiselt@highstreet-technologies.com>2019-02-07 17:50:41 +0100
committerHerbert Eiselt <herbert.eiselt@highstreet-technologies.com>2019-02-07 17:51:11 +0100
commit12a8c669f52c0e84d580c078cee849b25133b585 (patch)
tree1a0ddb6cc13f225e8a58833b8975f98b453a8d52 /sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators
parentbd2aa3c75e0073ff07fb46b14b8b51926915d5c8 (diff)
Add sdnr wt devicemanager
Add complete sdnr wireless transport app devicemanager Change-Id: I433014ee579a3c8833b3b8f84c4087c5f776704f Issue-ID: SDNC-575 Signed-off-by: Herbert Eiselt <herbert.eiselt@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators')
-rwxr-xr-xsdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/conflictingField.sh50
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/delete_all_indices.sh6
-rwxr-xr-xsdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/multi_type.sh75
-rwxr-xr-xsdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/twitter_feed.sh45
-rwxr-xr-xsdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/twitter_river.sh28
5 files changed, 204 insertions, 0 deletions
diff --git a/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/conflictingField.sh b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/conflictingField.sh
new file mode 100755
index 000000000..917d896ca
--- /dev/null
+++ b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/conflictingField.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+curl -XDELETE 'http://localhost:9200/conflicting_field_type'
+echo
+curl -XPUT 'http://localhost:9200/conflicting_field_type'
+echo
+curl -XPUT 'http://localhost:9200/conflicting_field_type/map1/_mapping' -d '{
+ "map1": {
+ "date_formats": ["date_time", "yyyyMMddHHmmss", "yyyyMMddHHmmssSSS"],
+ "_all": {
+ "enabled": true,
+ "store": "yes"
+ },
+ "properties": {
+ "field1": {
+ "type": "date",
+ "store": "yes",
+ "format": "yyyyMMddHHmmssSSS",
+ "include_in_all": false
+ }
+ }
+ }
+}'
+echo
+curl -XPUT 'http://localhost:9200/conflicting_field_type/map2/_mapping' -d '{
+ "map2": {
+ "date_formats": ["date_time", "yyyyMMddHHmmss", "yyyyMMddHHmmssSSS"],
+ "_all": {
+ "enabled": true,
+ "store": "yes"
+ },
+ "properties": {
+ "field1": {
+ "type": "string",
+ "store": "yes",
+ "term_vector": "yes",
+ "include_in_all": false
+ }
+ }
+ }
+}'
+echo
+curl -XPUT 'http://localhost:9200/conflicting_field_type/map1/1' -d '{
+ "field1" : "20110214172449000"
+}'
+echo
+curl -XPUT 'http://localhost:9200/conflicting_field_type/map2/2' -d '{
+ "field1" : "Test map2 with string type field"
+}'
+echo \ No newline at end of file
diff --git a/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/delete_all_indices.sh b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/delete_all_indices.sh
new file mode 100644
index 000000000..878964c54
--- /dev/null
+++ b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/delete_all_indices.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+curl -XDELETE 'http://localhost:9200/conflicting_field_type'
+echo
+curl -XDELETE 'http://localhost:9200/twitter'
+echo
diff --git a/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/multi_type.sh b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/multi_type.sh
new file mode 100755
index 000000000..562346275
--- /dev/null
+++ b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/multi_type.sh
@@ -0,0 +1,75 @@
+curl -XDELETE 'http://localhost:9200/multi_field_type'
+echo
+curl -XPUT 'http://localhost:9200/multi_field_type'
+echo
+curl -XPUT 'http://localhost:9200/multi_field_type/map1/_mapping' -d '{
+ "map1": {
+ "properties": {
+ "field1": {
+ "type": "string",
+ "store": "yes"
+ },
+ "field2": {
+ "type": "multi_field",
+ "path": "full",
+ "fields": {
+ "field2": { "type": "string" },
+ "alt_name": { "type": "string" },
+ "alt_name2": { "type": "string" }
+ }
+ },
+ "field3": {
+ "type": "multi_field",
+ "path": "just_name",
+ "fields": {
+ "field3": { "type": "string" },
+ "foobar": { "type": "string" }
+ }
+ },
+ "field4": {
+ "type": "multi_field",
+ "path": "just_name",
+ "fields": {
+ "field4": { "type": "string" },
+ "foobar": { "type": "string" }
+ }
+ },
+ "field5": {
+ "type": "string"
+ }
+ }
+ }
+}'
+echo
+curl -XPUT 'http://localhost:9200/multi_field_type/map1/1' -d '{
+ "field1": "Whats the dogs name",
+ "field2": "Max",
+ "field3": "Hey Janelle, whats wrong with Wolfie? I can hear him barking",
+ "field4": "Wolfies fine, honey, Wolfies just fine. Where are you",
+ "field5": "Your foster parents are dead"
+}'
+echo
+curl -XPUT 'http://localhost:9200/multi_field_type/map1/2' -d '{
+ "field1": "Nice night for a walk, eh",
+ "field2": "Nice night for a walk",
+ "field3": "Wash day tomorrow? Nothing clean, right?",
+ "field4": "Nothing clean. Right",
+ "field5": "Hey, I think this guys a couple cans short of a six-pack"
+}'
+echo
+curl -XPUT 'http://localhost:9200/multi_field_type/map1/3' -d '{
+ "field1": "The 600 series had rubber skin. We spotted them easy, but these are new. They look human... sweat, bad breath, everything. Very hard to spot. I had to wait till he moved on you before I could zero him",
+ "field2": "Look... I am not stupid, you know. They cannot make things like that yet.",
+ "field3": "Not yet. Not for about 40 years",
+ "field4": "Are you saying its from the future?",
+ "field5": "One possible future. From your point of view... I dont know tech stuff"
+}'
+echo
+curl -XPUT 'http://localhost:9200/multi_field_type/map1/4' -d '{
+ "field1": "Did you see this war?",
+ "field2": "No. I grew up after. In the ruins... starving... hiding from H-Ks",
+ "field3": "H-Ks?",
+ "field4": "Hunter-Killers. Patrol machines built in automated factories. Most of us were rounded up, put in camps for orderly disposal",
+ "field5": "This is burned in by laser scan. Some of us were kept alive... to work... loading bodies. The disposal units ran night and day. We were that close to going out forever. But there was one man who taught us to fight, to storm the wire of the camps, to smash those metal motherfuckers into junk. He turned it around. He brought us back from the brink. His name is Connor. John Connor. Your son, Sarah, your unborn son"
+}'
+echo
diff --git a/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/twitter_feed.sh b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/twitter_feed.sh
new file mode 100755
index 000000000..165246aab
--- /dev/null
+++ b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/twitter_feed.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+curl -XDELETE 'http://localhost:9200/twitter'
+echo
+curl -XPUT 'http://localhost:9200/twitter'
+echo
+curl -XPUT 'http://localhost:9200/twitter/_mapping' -d '{
+ "tweet": {
+ "date_formats": ["date_time", "yyyyMMddHHmmss", "yyyyMMddHHmmssSSS"],
+ "properties" : {
+ "user" : { "type" : "string", "index" : "not_analyzed" },
+ "message" : { "type" : "string" },
+ "postDate" : { "type" : "date" },
+ "srcAddr" : { "type" : "ip" },
+ "priority" : { "type" : "integer", null_value: 1 },
+ "rank" : { "type" : "float", null_value: 1.0 },
+ "loc" : { "type": "geo_point" }
+ }
+ }
+}'
+echo
+curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{
+ "user" : "mobz",
+ "message" : "developing a tool to search with",
+ "postDate" : "20110220100330",
+ "srcAddr" : "203.19.74.11",
+ "loc" : "-37.86,144.90"
+}'
+echo
+curl -XPUT 'http://localhost:9200/twitter/tweet/2' -d '{
+ "user" : "mobz",
+ "message" : "you know, for elastic search",
+ "postDate" : "20110220095900",
+ "srcAddr" : "203.19.74.11",
+ "loc" : "-37.86,144.90"
+}'
+echo
+curl -XPUT 'http://localhost:9200/twitter/tweet/3' -d '{
+ "user" : "mobz",
+ "message" : "lets take some matilda bay",
+ "postDate" : "20110221171330",
+ "srcAddr" : "203.19.74.11",
+ "loc" : "-37.86,144.90"
+}'
+echo \ No newline at end of file
diff --git a/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/twitter_river.sh b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/twitter_river.sh
new file mode 100755
index 000000000..e55c66537
--- /dev/null
+++ b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/test/generators/twitter_river.sh
@@ -0,0 +1,28 @@
+curl -XDELETE 'http://localhost:9200/twitter_river'
+echo
+curl -XDELETE 'http://localhost:9200/_river/twitter_river'
+echo
+curl -XPUT 'http://localhost:9200/twitter_river'
+echo
+read -p "consumer key: " consumer_key
+read -p "consumer secret: " consumer_secret
+read -p "access token: " access_token
+read -p "access token secret: " access_token_secret
+curl -XPUT 'localhost:9200/_river/twitter_river/_meta' -d '
+{
+ "type" : "twitter",
+ "twitter" : {
+ "oauth": {
+ "consumer_key": "'${consumer_key}'",
+ "consumer_secret": "'${consumer_secret}'",
+ "access_token": "'${access_token}'",
+ "access_token_secret": "'${access_token_secret}'"
+ }
+ },
+ "index": {
+ "index": "twitter_river",
+ "type": "status",
+ "buk_size": 100
+ }
+}'
+echo \ No newline at end of file