diff --git a/awscli/customizations/cloudsearch.py b/awscli/customizations/cloudsearch.py index edc4773f2830..f1311d723829 100644 --- a/awscli/customizations/cloudsearch.py +++ b/awscli/customizations/cloudsearch.py @@ -98,6 +98,9 @@ def index_hydrate(params, container, cli_type, key, value): "hydrate": index_hydrate}), ("IntOptions.SortEnabled", {"name": "sort-enabled", "hydrate": index_hydrate}), + ("IntOptions.SourceField", {"name": "source-field", + "type": "string", + "hydrate": index_hydrate }), ("TextOptions.HighlightEnabled", {"name": "highlight-enabled", "hydrate": index_hydrate}), ("TextOptions.AnalysisScheme", {"name": "analysis-scheme", diff --git a/tests/functional/cloudsearch/test_cloudsearch.py b/tests/functional/cloudsearch/test_cloudsearch.py index 8535c2acf5b2..5550c822633d 100644 --- a/tests/functional/cloudsearch/test_cloudsearch.py +++ b/tests/functional/cloudsearch/test_cloudsearch.py @@ -41,12 +41,14 @@ def test_flattened(self): cmdline += ' --type int' cmdline += ' --default-value 10' cmdline += ' --search-enabled false' + cmdline += ' --source-field fieldname123' result = { 'DomainName': 'abc123', 'IndexField': {'IndexFieldName': 'foo', 'IndexFieldType': 'int', 'IntOptions': {'DefaultValue': 10, - 'SearchEnabled': False}}} + 'SearchEnabled': False, + 'SourceField': 'fieldname123'}}} self.assert_params_for_cmd(cmdline, result) def test_latlon(self): @@ -56,11 +58,12 @@ def test_latlon(self): cmdline += ' --type latlon' cmdline += ' --default-value 10' cmdline += ' --search-enabled false' + cmdline += ' --source-field fieldname123' result = { 'DomainName': 'abc123', 'IndexField': { 'IndexFieldName': 'foo', 'IndexFieldType': 'latlon', 'LatLonOptions': { - 'DefaultValue': '10', 'SearchEnabled': False}}} + 'DefaultValue': '10', 'SearchEnabled': False, 'SourceField': 'fieldname123'}}} self.assert_params_for_cmd(cmdline, result)