示例#1
0
func ExampleCloudSearch_UpdateAvailabilityOptions() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudsearch.New(sess)

	params := &cloudsearch.UpdateAvailabilityOptionsInput{
		DomainName: aws.String("DomainName"), // Required
		MultiAZ:    aws.Bool(true),           // Required
	}
	resp, err := svc.UpdateAvailabilityOptions(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#2
0
func ExampleCloudSearch_DefineSuggester() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudsearch.New(sess)

	params := &cloudsearch.DefineSuggesterInput{
		DomainName: aws.String("DomainName"), // Required
		Suggester: &cloudsearch.Suggester{ // Required
			DocumentSuggesterOptions: &cloudsearch.DocumentSuggesterOptions{ // Required
				SourceField:    aws.String("FieldName"), // Required
				FuzzyMatching:  aws.String("SuggesterFuzzyMatching"),
				SortExpression: aws.String("String"),
			},
			SuggesterName: aws.String("StandardName"), // Required
		},
	}
	resp, err := svc.DefineSuggester(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#3
0
func ExampleCloudSearch_UpdateScalingParameters() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudsearch.New(sess)

	params := &cloudsearch.UpdateScalingParametersInput{
		DomainName: aws.String("DomainName"), // Required
		ScalingParameters: &cloudsearch.ScalingParameters{ // Required
			DesiredInstanceType:     aws.String("PartitionInstanceType"),
			DesiredPartitionCount:   aws.Int64(1),
			DesiredReplicationCount: aws.Int64(1),
		},
	}
	resp, err := svc.UpdateScalingParameters(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#4
0
func ExampleCloudSearch_UpdateServiceAccessPolicies() {
	svc := cloudsearch.New(nil)

	params := &cloudsearch.UpdateServiceAccessPoliciesInput{
		AccessPolicies: aws.String("PolicyDocument"), // Required
		DomainName:     aws.String("DomainName"),     // Required
	}
	resp, err := svc.UpdateServiceAccessPolicies(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
示例#5
0
func ExampleCloudSearch_DeleteSuggester() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudsearch.New(sess)

	params := &cloudsearch.DeleteSuggesterInput{
		DomainName:    aws.String("DomainName"),   // Required
		SuggesterName: aws.String("StandardName"), // Required
	}
	resp, err := svc.DeleteSuggester(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#6
0
func ExampleCloudSearch_DescribeSuggesters() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudsearch.New(sess)

	params := &cloudsearch.DescribeSuggestersInput{
		DomainName: aws.String("DomainName"), // Required
		Deployed:   aws.Bool(true),
		SuggesterNames: []*string{
			aws.String("StandardName"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeSuggesters(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#7
0
func ExampleCloudSearch_UpdateScalingParameters() {
	svc := cloudsearch.New(nil)

	params := &cloudsearch.UpdateScalingParametersInput{
		DomainName: aws.String("DomainName"), // Required
		ScalingParameters: &cloudsearch.ScalingParameters{ // Required
			DesiredInstanceType:     aws.String("PartitionInstanceType"),
			DesiredPartitionCount:   aws.Int64(1),
			DesiredReplicationCount: aws.Int64(1),
		},
	}
	resp, err := svc.UpdateScalingParameters(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
示例#8
0
func ExampleCloudSearch_DescribeSuggesters() {
	svc := cloudsearch.New(nil)

	params := &cloudsearch.DescribeSuggestersInput{
		DomainName: aws.String("DomainName"), // Required
		Deployed:   aws.Bool(true),
		SuggesterNames: []*string{
			aws.String("StandardName"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeSuggesters(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
示例#9
0
func ExampleCloudSearch_DefineSuggester() {
	svc := cloudsearch.New(nil)

	params := &cloudsearch.DefineSuggesterInput{
		DomainName: aws.String("DomainName"), // Required
		Suggester: &cloudsearch.Suggester{ // Required
			DocumentSuggesterOptions: &cloudsearch.DocumentSuggesterOptions{ // Required
				SourceField:    aws.String("FieldName"), // Required
				FuzzyMatching:  aws.String("SuggesterFuzzyMatching"),
				SortExpression: aws.String("String"),
			},
			SuggesterName: aws.String("StandardName"), // Required
		},
	}
	resp, err := svc.DefineSuggester(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
示例#10
0
func ExampleCloudSearch_UpdateServiceAccessPolicies() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudsearch.New(sess)

	params := &cloudsearch.UpdateServiceAccessPoliciesInput{
		AccessPolicies: aws.String("PolicyDocument"), // Required
		DomainName:     aws.String("DomainName"),     // Required
	}
	resp, err := svc.UpdateServiceAccessPolicies(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#11
0
func ExampleCloudSearch_DeleteIndexField() {
	svc := cloudsearch.New(nil)

	params := &cloudsearch.DeleteIndexFieldInput{
		DomainName:     aws.String("DomainName"),       // Required
		IndexFieldName: aws.String("DynamicFieldName"), // Required
	}
	resp, err := svc.DeleteIndexField(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS Error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
示例#12
0
func ExampleCloudSearch_DefineAnalysisScheme() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudsearch.New(sess)

	params := &cloudsearch.DefineAnalysisSchemeInput{
		AnalysisScheme: &cloudsearch.AnalysisScheme{ // Required
			AnalysisSchemeLanguage: aws.String("AnalysisSchemeLanguage"), // Required
			AnalysisSchemeName:     aws.String("StandardName"),           // Required
			AnalysisOptions: &cloudsearch.AnalysisOptions{
				AlgorithmicStemming:            aws.String("AlgorithmicStemming"),
				JapaneseTokenizationDictionary: aws.String("String"),
				StemmingDictionary:             aws.String("String"),
				Stopwords:                      aws.String("String"),
				Synonyms:                       aws.String("String"),
			},
		},
		DomainName: aws.String("DomainName"), // Required
	}
	resp, err := svc.DefineAnalysisScheme(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#13
0
func ExampleCloudSearch_ListDomainNames() {
	svc := cloudsearch.New(nil)

	var params *cloudsearch.ListDomainNamesInput
	resp, err := svc.ListDomainNames(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
func ExampleCloudSearch_DescribeScalingParameters() {
	svc := cloudsearch.New(session.New())

	params := &cloudsearch.DescribeScalingParametersInput{
		DomainName: aws.String("DomainName"), // Required
	}
	resp, err := svc.DescribeScalingParameters(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#15
0
func ExampleCloudSearch_IndexDocuments() {
	svc := cloudsearch.New(nil)

	params := &cloudsearch.IndexDocumentsInput{
		DomainName: aws.String("DomainName"), // Required
	}
	resp, err := svc.IndexDocuments(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#16
0
func ExampleCloudSearch_DeleteAnalysisScheme() {
	svc := cloudsearch.New(nil)

	params := &cloudsearch.DeleteAnalysisSchemeInput{
		AnalysisSchemeName: aws.String("StandardName"), // Required
		DomainName:         aws.String("DomainName"),   // Required
	}
	resp, err := svc.DeleteAnalysisScheme(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#17
0
func ExampleCloudSearch_DescribeServiceAccessPolicies() {
	svc := cloudsearch.New(nil)

	params := &cloudsearch.DescribeServiceAccessPoliciesInput{
		DomainName: aws.String("DomainName"), // Required
		Deployed:   aws.Bool(true),
	}
	resp, err := svc.DescribeServiceAccessPolicies(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#18
0
func ExampleCloudSearch_DescribeDomains() {
	svc := cloudsearch.New(nil)

	params := &cloudsearch.DescribeDomainsInput{
		DomainNames: []*string{
			aws.String("DomainName"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeDomains(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#19
0
func ExampleCloudSearch_ListDomainNames() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudsearch.New(sess)

	var params *cloudsearch.ListDomainNamesInput
	resp, err := svc.ListDomainNames(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#20
0
func ExampleCloudSearch_DefineExpression() {
	svc := cloudsearch.New(nil)

	params := &cloudsearch.DefineExpressionInput{
		DomainName: aws.String("DomainName"), // Required
		Expression: &cloudsearch.Expression{ // Required
			ExpressionName:  aws.String("StandardName"),    // Required
			ExpressionValue: aws.String("ExpressionValue"), // Required
		},
	}
	resp, err := svc.DefineExpression(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
func ExampleCloudSearch_DescribeIndexFields() {
	svc := cloudsearch.New(session.New())

	params := &cloudsearch.DescribeIndexFieldsInput{
		DomainName: aws.String("DomainName"), // Required
		Deployed:   aws.Bool(true),
		FieldNames: []*string{
			aws.String("DynamicFieldName"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeIndexFields(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#22
0
func ExampleCloudSearch_DefineAnalysisScheme() {
	svc := cloudsearch.New(nil)

	params := &cloudsearch.DefineAnalysisSchemeInput{
		AnalysisScheme: &cloudsearch.AnalysisScheme{ // Required
			AnalysisSchemeLanguage: aws.String("AnalysisSchemeLanguage"), // Required
			AnalysisSchemeName:     aws.String("StandardName"),           // Required
			AnalysisOptions: &cloudsearch.AnalysisOptions{
				AlgorithmicStemming:            aws.String("AlgorithmicStemming"),
				JapaneseTokenizationDictionary: aws.String("String"),
				StemmingDictionary:             aws.String("String"),
				Stopwords:                      aws.String("String"),
				Synonyms:                       aws.String("String"),
			},
		},
		DomainName: aws.String("DomainName"), // Required
	}
	resp, err := svc.DefineAnalysisScheme(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
示例#23
0
func ExampleCloudSearch_ListDomainNames() {
	svc := cloudsearch.New(nil)

	var params *cloudsearch.ListDomainNamesInput
	resp, err := svc.ListDomainNames(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
示例#24
0
func init() {
	Before("@cloudsearch", func() {
		World["client"] = cloudsearch.New(nil)
	})
}
示例#25
0
func TestInterface(t *testing.T) {
	assert.Implements(t, (*cloudsearchiface.CloudSearchAPI)(nil), cloudsearch.New(nil))
}
示例#26
0
func ExampleCloudSearch_DefineIndexField() {
	svc := cloudsearch.New(nil)

	params := &cloudsearch.DefineIndexFieldInput{
		DomainName: aws.String("DomainName"), // Required
		IndexField: &cloudsearch.IndexField{ // Required
			IndexFieldName: aws.String("DynamicFieldName"), // Required
			IndexFieldType: aws.String("IndexFieldType"),   // Required
			DateArrayOptions: &cloudsearch.DateArrayOptions{
				DefaultValue:  aws.String("FieldValue"),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SourceFields:  aws.String("FieldNameCommaList"),
			},
			DateOptions: &cloudsearch.DateOptions{
				DefaultValue:  aws.String("FieldValue"),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SortEnabled:   aws.Bool(true),
				SourceField:   aws.String("FieldName"),
			},
			DoubleArrayOptions: &cloudsearch.DoubleArrayOptions{
				DefaultValue:  aws.Float64(1.0),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SourceFields:  aws.String("FieldNameCommaList"),
			},
			DoubleOptions: &cloudsearch.DoubleOptions{
				DefaultValue:  aws.Float64(1.0),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SortEnabled:   aws.Bool(true),
				SourceField:   aws.String("FieldName"),
			},
			IntArrayOptions: &cloudsearch.IntArrayOptions{
				DefaultValue:  aws.Int64(1),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SourceFields:  aws.String("FieldNameCommaList"),
			},
			IntOptions: &cloudsearch.IntOptions{
				DefaultValue:  aws.Int64(1),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SortEnabled:   aws.Bool(true),
				SourceField:   aws.String("FieldName"),
			},
			LatLonOptions: &cloudsearch.LatLonOptions{
				DefaultValue:  aws.String("FieldValue"),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SortEnabled:   aws.Bool(true),
				SourceField:   aws.String("FieldName"),
			},
			LiteralArrayOptions: &cloudsearch.LiteralArrayOptions{
				DefaultValue:  aws.String("FieldValue"),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SourceFields:  aws.String("FieldNameCommaList"),
			},
			LiteralOptions: &cloudsearch.LiteralOptions{
				DefaultValue:  aws.String("FieldValue"),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SortEnabled:   aws.Bool(true),
				SourceField:   aws.String("FieldName"),
			},
			TextArrayOptions: &cloudsearch.TextArrayOptions{
				AnalysisScheme:   aws.String("Word"),
				DefaultValue:     aws.String("FieldValue"),
				HighlightEnabled: aws.Bool(true),
				ReturnEnabled:    aws.Bool(true),
				SourceFields:     aws.String("FieldNameCommaList"),
			},
			TextOptions: &cloudsearch.TextOptions{
				AnalysisScheme:   aws.String("Word"),
				DefaultValue:     aws.String("FieldValue"),
				HighlightEnabled: aws.Bool(true),
				ReturnEnabled:    aws.Bool(true),
				SortEnabled:      aws.Bool(true),
				SourceField:      aws.String("FieldName"),
			},
		},
	}
	resp, err := svc.DefineIndexField(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
示例#27
0
文件: client.go 项目: CNDonny/scope
func init() {
	Before("@cloudsearch", func() {
		World["client"] = cloudsearch.New(smoke.Session)
	})
}
示例#28
0
func ExampleCloudSearch_DefineIndexField() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudsearch.New(sess)

	params := &cloudsearch.DefineIndexFieldInput{
		DomainName: aws.String("DomainName"), // Required
		IndexField: &cloudsearch.IndexField{ // Required
			IndexFieldName: aws.String("DynamicFieldName"), // Required
			IndexFieldType: aws.String("IndexFieldType"),   // Required
			DateArrayOptions: &cloudsearch.DateArrayOptions{
				DefaultValue:  aws.String("FieldValue"),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SourceFields:  aws.String("FieldNameCommaList"),
			},
			DateOptions: &cloudsearch.DateOptions{
				DefaultValue:  aws.String("FieldValue"),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SortEnabled:   aws.Bool(true),
				SourceField:   aws.String("FieldName"),
			},
			DoubleArrayOptions: &cloudsearch.DoubleArrayOptions{
				DefaultValue:  aws.Float64(1.0),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SourceFields:  aws.String("FieldNameCommaList"),
			},
			DoubleOptions: &cloudsearch.DoubleOptions{
				DefaultValue:  aws.Float64(1.0),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SortEnabled:   aws.Bool(true),
				SourceField:   aws.String("FieldName"),
			},
			IntArrayOptions: &cloudsearch.IntArrayOptions{
				DefaultValue:  aws.Int64(1),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SourceFields:  aws.String("FieldNameCommaList"),
			},
			IntOptions: &cloudsearch.IntOptions{
				DefaultValue:  aws.Int64(1),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SortEnabled:   aws.Bool(true),
				SourceField:   aws.String("FieldName"),
			},
			LatLonOptions: &cloudsearch.LatLonOptions{
				DefaultValue:  aws.String("FieldValue"),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SortEnabled:   aws.Bool(true),
				SourceField:   aws.String("FieldName"),
			},
			LiteralArrayOptions: &cloudsearch.LiteralArrayOptions{
				DefaultValue:  aws.String("FieldValue"),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SourceFields:  aws.String("FieldNameCommaList"),
			},
			LiteralOptions: &cloudsearch.LiteralOptions{
				DefaultValue:  aws.String("FieldValue"),
				FacetEnabled:  aws.Bool(true),
				ReturnEnabled: aws.Bool(true),
				SearchEnabled: aws.Bool(true),
				SortEnabled:   aws.Bool(true),
				SourceField:   aws.String("FieldName"),
			},
			TextArrayOptions: &cloudsearch.TextArrayOptions{
				AnalysisScheme:   aws.String("Word"),
				DefaultValue:     aws.String("FieldValue"),
				HighlightEnabled: aws.Bool(true),
				ReturnEnabled:    aws.Bool(true),
				SourceFields:     aws.String("FieldNameCommaList"),
			},
			TextOptions: &cloudsearch.TextOptions{
				AnalysisScheme:   aws.String("Word"),
				DefaultValue:     aws.String("FieldValue"),
				HighlightEnabled: aws.Bool(true),
				ReturnEnabled:    aws.Bool(true),
				SortEnabled:      aws.Bool(true),
				SourceField:      aws.String("FieldName"),
			},
		},
	}
	resp, err := svc.DefineIndexField(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}