-
Notifications
You must be signed in to change notification settings - Fork 2
/
meta_mapping.sh
executable file
·47 lines (36 loc) · 918 Bytes
/
meta_mapping.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
# This test shows that the Update Mapping API replaces the meta field
# in the mapping rather than only adding/updating the provided fields.
alias curl='./curl_wrapper.rb'
curl -s -XDELETE localhost:9200/test > /dev/null
curl -XPOST localhost:9200/test -d '{
"mappings" : {
"product" : {
"properties" : {
"tags" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
}
}'
curl -XPUT localhost:9200/test/product/_mapping -d '{
"product" : {
"_meta" : {
"obj": {
"field1" : 1
}
}
}
}'
curl localhost:9200/test/product/_mapping?pretty=true
curl -XPUT localhost:9200/test/product/_mapping -d '{
"product" : {
"_meta" : {
"field2" : 2
}
}
}'
curl localhost:9200/test/product/_mapping?pretty=true
curl -s -XDELETE localhost:9200/test > /dev/null