Skip to content

Commit dc7c268

Browse files
authored
Merge pull request #6045 from pawanakhil/feature/cloudsearch/define-index-field_SourceField_Option
Feature: Added source field option for define-index-field command under CloudSearch
2 parents c71d1df + ccbe2a4 commit dc7c268

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

awscli/customizations/cloudsearch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ def index_hydrate(params, container, cli_type, key, value):
9898
"hydrate": index_hydrate}),
9999
("IntOptions.SortEnabled", {"name": "sort-enabled",
100100
"hydrate": index_hydrate}),
101+
("IntOptions.SourceField", {"name": "source-field",
102+
"type": "string",
103+
"hydrate": index_hydrate }),
101104
("TextOptions.HighlightEnabled", {"name": "highlight-enabled",
102105
"hydrate": index_hydrate}),
103106
("TextOptions.AnalysisScheme", {"name": "analysis-scheme",

tests/functional/cloudsearch/test_cloudsearch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ def test_flattened(self):
4141
cmdline += ' --type int'
4242
cmdline += ' --default-value 10'
4343
cmdline += ' --search-enabled false'
44+
cmdline += ' --source-field fieldname123'
4445
result = {
4546
'DomainName': 'abc123',
4647
'IndexField': {'IndexFieldName': 'foo',
4748
'IndexFieldType': 'int',
4849
'IntOptions': {'DefaultValue': 10,
49-
'SearchEnabled': False}}}
50+
'SearchEnabled': False,
51+
'SourceField': 'fieldname123'}}}
5052
self.assert_params_for_cmd(cmdline, result)
5153

5254
def test_latlon(self):
@@ -56,11 +58,12 @@ def test_latlon(self):
5658
cmdline += ' --type latlon'
5759
cmdline += ' --default-value 10'
5860
cmdline += ' --search-enabled false'
61+
cmdline += ' --source-field fieldname123'
5962
result = {
6063
'DomainName': 'abc123',
6164
'IndexField': {
6265
'IndexFieldName': 'foo',
6366
'IndexFieldType': 'latlon',
6467
'LatLonOptions': {
65-
'DefaultValue': '10', 'SearchEnabled': False}}}
68+
'DefaultValue': '10', 'SearchEnabled': False, 'SourceField': 'fieldname123'}}}
6669
self.assert_params_for_cmd(cmdline, result)

0 commit comments

Comments
 (0)