Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Added source field option for define-index-field command under CloudSearch #6045

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions awscli/customizations/cloudsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 5 additions & 2 deletions tests/functional/cloudsearch/test_cloudsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)