forked from elastic/elasticsearch
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Single type can now be added with `[PUT|POST] {index|_all|*|regex|blank}/[_mapping|_mappings]/type` and `[PUT|POST] {index|_all|*|regex|blank}/type/[_mapping|_mappings]` see roadmap at issue elastic#4071
- Loading branch information
Showing
5 changed files
with
264 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
184 changes: 184 additions & 0 deletions
184
rest-api-spec/test/indices.put_mapping/all_path_options.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
--- | ||
"Test Create and update mapping with all options (PUT {index|_all|*|prefix*}/type/_mapping)": | ||
|
||
# create two indices | ||
- do: | ||
indices.create: | ||
index: test_index1 | ||
- do: | ||
indices.create: | ||
index: test_index2 | ||
|
||
# put mapping per index | ||
- do: | ||
indices.put_mapping: | ||
index: test_index1 | ||
type: test_type | ||
body: | ||
test_type: | ||
properties: | ||
text: | ||
type: string | ||
analyzer: whitespace | ||
- do: | ||
indices.put_mapping: | ||
index: test_index2 | ||
type: test_type | ||
body: | ||
test_type: | ||
properties: | ||
text: | ||
type: string | ||
analyzer: whitespace | ||
|
||
|
||
- do: | ||
indices.get_mapping: | ||
index: test_index1 | ||
|
||
- match: {test_index1.test_type.properties.text.type: string} | ||
- match: {test_index1.test_type.properties.text.analyzer: whitespace} | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test_index2 | ||
|
||
- match: {test_index2.test_type.properties.text.type: string} | ||
- match: {test_index2.test_type.properties.text.analyzer: whitespace} | ||
|
||
|
||
|
||
# put mapping in _all index | ||
- do: | ||
indices.put_mapping: | ||
index: _all | ||
type: test_type1 | ||
body: | ||
test_type1: | ||
properties: | ||
text: | ||
type: string | ||
analyzer: whitespace | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test_index1 | ||
|
||
- match: {test_index1.test_type1.properties.text.type: string} | ||
- match: {test_index1.test_type1.properties.text.analyzer: whitespace} | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test_index2 | ||
|
||
- match: {test_index2.test_type1.properties.text.type: string} | ||
- match: {test_index2.test_type1.properties.text.analyzer: whitespace} | ||
|
||
|
||
# put mapping in * index | ||
- do: | ||
indices.put_mapping: | ||
index: "*" | ||
type: test_type2 | ||
body: | ||
test_type2: | ||
properties: | ||
text: | ||
type: string | ||
analyzer: whitespace | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test_index1 | ||
|
||
- match: {test_index1.test_type2.properties.text.type: string} | ||
- match: {test_index1.test_type2.properties.text.analyzer: whitespace} | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test_index2 | ||
|
||
- match: {test_index2.test_type2.properties.text.type: string} | ||
- match: {test_index2.test_type2.properties.text.analyzer: whitespace} | ||
|
||
# put mapping prefix* index | ||
- do: | ||
indices.put_mapping: | ||
index: "test_index*" | ||
type: test_type3 | ||
body: | ||
test_type3: | ||
properties: | ||
text: | ||
type: string | ||
analyzer: whitespace | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test_index1 | ||
|
||
- match: {test_index1.test_type3.properties.text.type: string} | ||
- match: {test_index1.test_type3.properties.text.analyzer: whitespace} | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test_index2 | ||
|
||
- match: {test_index2.test_type3.properties.text.type: string} | ||
- match: {test_index2.test_type3.properties.text.analyzer: whitespace} | ||
|
||
|
||
|
||
# put mapping in list of indices | ||
- do: | ||
indices.put_mapping: | ||
index: [test_index1, test_index2] | ||
type: test_type4 | ||
body: | ||
test_type4: | ||
properties: | ||
text: | ||
type: string | ||
analyzer: whitespace | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test_index1 | ||
|
||
- match: {test_index1.test_type4.properties.text.type: string} | ||
- match: {test_index1.test_type4.properties.text.analyzer: whitespace} | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test_index2 | ||
|
||
- match: {test_index2.test_type4.properties.text.type: string} | ||
- match: {test_index2.test_type4.properties.text.analyzer: whitespace} | ||
|
||
|
||
# put mapping with blank index | ||
- do: | ||
indices.put_mapping: | ||
type: test_type5 | ||
body: | ||
test_type5: | ||
properties: | ||
text: | ||
type: string | ||
analyzer: whitespace | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test_index1 | ||
|
||
- match: {test_index1.test_type5.properties.text.type: string} | ||
- match: {test_index1.test_type5.properties.text.analyzer: whitespace} | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test_index2 | ||
|
||
- match: {test_index2.test_type5.properties.text.type: string} | ||
- match: {test_index2.test_type5.properties.text.analyzer: whitespace} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters