1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2
3package cloudsearchdomain
4
5import (
6	"fmt"
7	"io"
8
9	"github.com/aws/aws-sdk-go/aws"
10	"github.com/aws/aws-sdk-go/aws/awsutil"
11	"github.com/aws/aws-sdk-go/aws/request"
12	"github.com/aws/aws-sdk-go/private/protocol"
13)
14
15const opSearch = "Search"
16
17// SearchRequest generates a "aws/request.Request" representing the
18// client's request for the Search operation. The "output" return
19// value will be populated with the request's response once the request completes
20// successfully.
21//
22// Use "Send" method on the returned Request to send the API call to the service.
23// the "output" return value is not valid until after Send returns without error.
24//
25// See Search for more information on using the Search
26// API call, and error handling.
27//
28// This method is useful when you want to inject custom logic or configuration
29// into the SDK's request lifecycle. Such as custom headers, or retry logic.
30//
31//
32//    // Example sending a request using the SearchRequest method.
33//    req, resp := client.SearchRequest(params)
34//
35//    err := req.Send()
36//    if err == nil { // resp is now filled
37//        fmt.Println(resp)
38//    }
39func (c *CloudSearchDomain) SearchRequest(input *SearchInput) (req *request.Request, output *SearchOutput) {
40	op := &request.Operation{
41		Name:       opSearch,
42		HTTPMethod: "GET",
43		HTTPPath:   "/2013-01-01/search?format=sdk&pretty=true",
44	}
45
46	if input == nil {
47		input = &SearchInput{}
48	}
49
50	output = &SearchOutput{}
51	req = c.newRequest(op, input, output)
52	return
53}
54
55// Search API operation for Amazon CloudSearch Domain.
56//
57// Retrieves a list of documents that match the specified search criteria. How
58// you specify the search criteria depends on which query parser you use. Amazon
59// CloudSearch supports four query parsers:
60//
61//    * simple: search all text and text-array fields for the specified string.
62//    Search for phrases, individual terms, and prefixes.
63//
64//    * structured: search specific fields, construct compound queries using
65//    Boolean operators, and use advanced features such as term boosting and
66//    proximity searching.
67//
68//    * lucene: specify search criteria using the Apache Lucene query parser
69//    syntax.
70//
71//    * dismax: specify search criteria using the simplified subset of the Apache
72//    Lucene query parser syntax defined by the DisMax query parser.
73//
74// For more information, see Searching Your Data (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching.html)
75// in the Amazon CloudSearch Developer Guide.
76//
77// The endpoint for submitting Search requests is domain-specific. You submit
78// search requests to a domain's search endpoint. To get the search endpoint
79// for your domain, use the Amazon CloudSearch configuration service DescribeDomains
80// action. A domain's endpoints are also displayed on the domain dashboard in
81// the Amazon CloudSearch console.
82//
83// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
84// with awserr.Error's Code and Message methods to get detailed information about
85// the error.
86//
87// See the AWS API reference guide for Amazon CloudSearch Domain's
88// API operation Search for usage and error information.
89//
90// Returned Error Types:
91//   * SearchException
92//   Information about any problems encountered while processing a search request.
93//
94func (c *CloudSearchDomain) Search(input *SearchInput) (*SearchOutput, error) {
95	req, out := c.SearchRequest(input)
96	return out, req.Send()
97}
98
99// SearchWithContext is the same as Search with the addition of
100// the ability to pass a context and additional request options.
101//
102// See Search for details on how to use this API operation.
103//
104// The context must be non-nil and will be used for request cancellation. If
105// the context is nil a panic will occur. In the future the SDK may create
106// sub-contexts for http.Requests. See https://golang.org/pkg/context/
107// for more information on using Contexts.
108func (c *CloudSearchDomain) SearchWithContext(ctx aws.Context, input *SearchInput, opts ...request.Option) (*SearchOutput, error) {
109	req, out := c.SearchRequest(input)
110	req.SetContext(ctx)
111	req.ApplyOptions(opts...)
112	return out, req.Send()
113}
114
115const opSuggest = "Suggest"
116
117// SuggestRequest generates a "aws/request.Request" representing the
118// client's request for the Suggest operation. The "output" return
119// value will be populated with the request's response once the request completes
120// successfully.
121//
122// Use "Send" method on the returned Request to send the API call to the service.
123// the "output" return value is not valid until after Send returns without error.
124//
125// See Suggest for more information on using the Suggest
126// API call, and error handling.
127//
128// This method is useful when you want to inject custom logic or configuration
129// into the SDK's request lifecycle. Such as custom headers, or retry logic.
130//
131//
132//    // Example sending a request using the SuggestRequest method.
133//    req, resp := client.SuggestRequest(params)
134//
135//    err := req.Send()
136//    if err == nil { // resp is now filled
137//        fmt.Println(resp)
138//    }
139func (c *CloudSearchDomain) SuggestRequest(input *SuggestInput) (req *request.Request, output *SuggestOutput) {
140	op := &request.Operation{
141		Name:       opSuggest,
142		HTTPMethod: "GET",
143		HTTPPath:   "/2013-01-01/suggest?format=sdk&pretty=true",
144	}
145
146	if input == nil {
147		input = &SuggestInput{}
148	}
149
150	output = &SuggestOutput{}
151	req = c.newRequest(op, input, output)
152	return
153}
154
155// Suggest API operation for Amazon CloudSearch Domain.
156//
157// Retrieves autocomplete suggestions for a partial query string. You can use
158// suggestions enable you to display likely matches before users finish typing.
159// In Amazon CloudSearch, suggestions are based on the contents of a particular
160// text field. When you request suggestions, Amazon CloudSearch finds all of
161// the documents whose values in the suggester field start with the specified
162// query string. The beginning of the field must match the query string to be
163// considered a match.
164//
165// For more information about configuring suggesters and retrieving suggestions,
166// see Getting Suggestions (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/getting-suggestions.html)
167// in the Amazon CloudSearch Developer Guide.
168//
169// The endpoint for submitting Suggest requests is domain-specific. You submit
170// suggest requests to a domain's search endpoint. To get the search endpoint
171// for your domain, use the Amazon CloudSearch configuration service DescribeDomains
172// action. A domain's endpoints are also displayed on the domain dashboard in
173// the Amazon CloudSearch console.
174//
175// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
176// with awserr.Error's Code and Message methods to get detailed information about
177// the error.
178//
179// See the AWS API reference guide for Amazon CloudSearch Domain's
180// API operation Suggest for usage and error information.
181//
182// Returned Error Types:
183//   * SearchException
184//   Information about any problems encountered while processing a search request.
185//
186func (c *CloudSearchDomain) Suggest(input *SuggestInput) (*SuggestOutput, error) {
187	req, out := c.SuggestRequest(input)
188	return out, req.Send()
189}
190
191// SuggestWithContext is the same as Suggest with the addition of
192// the ability to pass a context and additional request options.
193//
194// See Suggest for details on how to use this API operation.
195//
196// The context must be non-nil and will be used for request cancellation. If
197// the context is nil a panic will occur. In the future the SDK may create
198// sub-contexts for http.Requests. See https://golang.org/pkg/context/
199// for more information on using Contexts.
200func (c *CloudSearchDomain) SuggestWithContext(ctx aws.Context, input *SuggestInput, opts ...request.Option) (*SuggestOutput, error) {
201	req, out := c.SuggestRequest(input)
202	req.SetContext(ctx)
203	req.ApplyOptions(opts...)
204	return out, req.Send()
205}
206
207const opUploadDocuments = "UploadDocuments"
208
209// UploadDocumentsRequest generates a "aws/request.Request" representing the
210// client's request for the UploadDocuments operation. The "output" return
211// value will be populated with the request's response once the request completes
212// successfully.
213//
214// Use "Send" method on the returned Request to send the API call to the service.
215// the "output" return value is not valid until after Send returns without error.
216//
217// See UploadDocuments for more information on using the UploadDocuments
218// API call, and error handling.
219//
220// This method is useful when you want to inject custom logic or configuration
221// into the SDK's request lifecycle. Such as custom headers, or retry logic.
222//
223//
224//    // Example sending a request using the UploadDocumentsRequest method.
225//    req, resp := client.UploadDocumentsRequest(params)
226//
227//    err := req.Send()
228//    if err == nil { // resp is now filled
229//        fmt.Println(resp)
230//    }
231func (c *CloudSearchDomain) UploadDocumentsRequest(input *UploadDocumentsInput) (req *request.Request, output *UploadDocumentsOutput) {
232	op := &request.Operation{
233		Name:       opUploadDocuments,
234		HTTPMethod: "POST",
235		HTTPPath:   "/2013-01-01/documents/batch?format=sdk",
236	}
237
238	if input == nil {
239		input = &UploadDocumentsInput{}
240	}
241
242	output = &UploadDocumentsOutput{}
243	req = c.newRequest(op, input, output)
244	return
245}
246
247// UploadDocuments API operation for Amazon CloudSearch Domain.
248//
249// Posts a batch of documents to a search domain for indexing. A document batch
250// is a collection of add and delete operations that represent the documents
251// you want to add, update, or delete from your domain. Batches can be described
252// in either JSON or XML. Each item that you want Amazon CloudSearch to return
253// as a search result (such as a product) is represented as a document. Every
254// document has a unique ID and one or more fields that contain the data that
255// you want to search and return in results. Individual documents cannot contain
256// more than 1 MB of data. The entire batch cannot exceed 5 MB. To get the best
257// possible upload performance, group add and delete operations in batches that
258// are close the 5 MB limit. Submitting a large volume of single-document batches
259// can overload a domain's document service.
260//
261// The endpoint for submitting UploadDocuments requests is domain-specific.
262// To get the document endpoint for your domain, use the Amazon CloudSearch
263// configuration service DescribeDomains action. A domain's endpoints are also
264// displayed on the domain dashboard in the Amazon CloudSearch console.
265//
266// For more information about formatting your data for Amazon CloudSearch, see
267// Preparing Your Data (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/preparing-data.html)
268// in the Amazon CloudSearch Developer Guide. For more information about uploading
269// data for indexing, see Uploading Data (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/uploading-data.html)
270// in the Amazon CloudSearch Developer Guide.
271//
272// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
273// with awserr.Error's Code and Message methods to get detailed information about
274// the error.
275//
276// See the AWS API reference guide for Amazon CloudSearch Domain's
277// API operation UploadDocuments for usage and error information.
278//
279// Returned Error Types:
280//   * DocumentServiceException
281//   Information about any problems encountered while processing an upload request.
282//
283func (c *CloudSearchDomain) UploadDocuments(input *UploadDocumentsInput) (*UploadDocumentsOutput, error) {
284	req, out := c.UploadDocumentsRequest(input)
285	return out, req.Send()
286}
287
288// UploadDocumentsWithContext is the same as UploadDocuments with the addition of
289// the ability to pass a context and additional request options.
290//
291// See UploadDocuments for details on how to use this API operation.
292//
293// The context must be non-nil and will be used for request cancellation. If
294// the context is nil a panic will occur. In the future the SDK may create
295// sub-contexts for http.Requests. See https://golang.org/pkg/context/
296// for more information on using Contexts.
297func (c *CloudSearchDomain) UploadDocumentsWithContext(ctx aws.Context, input *UploadDocumentsInput, opts ...request.Option) (*UploadDocumentsOutput, error) {
298	req, out := c.UploadDocumentsRequest(input)
299	req.SetContext(ctx)
300	req.ApplyOptions(opts...)
301	return out, req.Send()
302}
303
304// A container for facet information.
305type Bucket struct {
306	_ struct{} `type:"structure"`
307
308	// The number of hits that contain the facet value in the specified facet field.
309	Count *int64 `locationName:"count" type:"long"`
310
311	// The facet value being counted.
312	Value *string `locationName:"value" type:"string"`
313}
314
315// String returns the string representation
316func (s Bucket) String() string {
317	return awsutil.Prettify(s)
318}
319
320// GoString returns the string representation
321func (s Bucket) GoString() string {
322	return s.String()
323}
324
325// SetCount sets the Count field's value.
326func (s *Bucket) SetCount(v int64) *Bucket {
327	s.Count = &v
328	return s
329}
330
331// SetValue sets the Value field's value.
332func (s *Bucket) SetValue(v string) *Bucket {
333	s.Value = &v
334	return s
335}
336
337// A container for the calculated facet values and counts.
338type BucketInfo struct {
339	_ struct{} `type:"structure"`
340
341	// A list of the calculated facet values and counts.
342	Buckets []*Bucket `locationName:"buckets" type:"list"`
343}
344
345// String returns the string representation
346func (s BucketInfo) String() string {
347	return awsutil.Prettify(s)
348}
349
350// GoString returns the string representation
351func (s BucketInfo) GoString() string {
352	return s.String()
353}
354
355// SetBuckets sets the Buckets field's value.
356func (s *BucketInfo) SetBuckets(v []*Bucket) *BucketInfo {
357	s.Buckets = v
358	return s
359}
360
361// Information about any problems encountered while processing an upload request.
362type DocumentServiceException struct {
363	_            struct{}                  `type:"structure"`
364	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
365
366	// The description of the errors returned by the document service.
367	Message_ *string `locationName:"message" type:"string"`
368
369	// The return status of a document upload request, error or success.
370	Status *string `locationName:"status" type:"string"`
371}
372
373// String returns the string representation
374func (s DocumentServiceException) String() string {
375	return awsutil.Prettify(s)
376}
377
378// GoString returns the string representation
379func (s DocumentServiceException) GoString() string {
380	return s.String()
381}
382
383func newErrorDocumentServiceException(v protocol.ResponseMetadata) error {
384	return &DocumentServiceException{
385		RespMetadata: v,
386	}
387}
388
389// Code returns the exception type name.
390func (s *DocumentServiceException) Code() string {
391	return "DocumentServiceException"
392}
393
394// Message returns the exception's message.
395func (s *DocumentServiceException) Message() string {
396	if s.Message_ != nil {
397		return *s.Message_
398	}
399	return ""
400}
401
402// OrigErr always returns nil, satisfies awserr.Error interface.
403func (s *DocumentServiceException) OrigErr() error {
404	return nil
405}
406
407func (s *DocumentServiceException) Error() string {
408	return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String())
409}
410
411// Status code returns the HTTP status code for the request's response error.
412func (s *DocumentServiceException) StatusCode() int {
413	return s.RespMetadata.StatusCode
414}
415
416// RequestID returns the service's response RequestID for request.
417func (s *DocumentServiceException) RequestID() string {
418	return s.RespMetadata.RequestID
419}
420
421// A warning returned by the document service when an issue is discovered while
422// processing an upload request.
423type DocumentServiceWarning struct {
424	_ struct{} `type:"structure"`
425
426	// The description for a warning returned by the document service.
427	Message *string `locationName:"message" type:"string"`
428}
429
430// String returns the string representation
431func (s DocumentServiceWarning) String() string {
432	return awsutil.Prettify(s)
433}
434
435// GoString returns the string representation
436func (s DocumentServiceWarning) GoString() string {
437	return s.String()
438}
439
440// SetMessage sets the Message field's value.
441func (s *DocumentServiceWarning) SetMessage(v string) *DocumentServiceWarning {
442	s.Message = &v
443	return s
444}
445
446// The statistics for a field calculated in the request.
447type FieldStats struct {
448	_ struct{} `type:"structure"`
449
450	// The number of documents that contain a value in the specified field in the
451	// result set.
452	Count *int64 `locationName:"count" type:"long"`
453
454	// The maximum value found in the specified field in the result set.
455	//
456	// If the field is numeric (int, int-array, double, or double-array), max is
457	// the string representation of a double-precision 64-bit floating point value.
458	// If the field is date or date-array, max is the string representation of a
459	// date with the format specified in IETF RFC3339 (http://tools.ietf.org/html/rfc3339):
460	// yyyy-mm-ddTHH:mm:ss.SSSZ.
461	Max *string `locationName:"max" type:"string"`
462
463	// The average of the values found in the specified field in the result set.
464	//
465	// If the field is numeric (int, int-array, double, or double-array), mean is
466	// the string representation of a double-precision 64-bit floating point value.
467	// If the field is date or date-array, mean is the string representation of
468	// a date with the format specified in IETF RFC3339 (http://tools.ietf.org/html/rfc3339):
469	// yyyy-mm-ddTHH:mm:ss.SSSZ.
470	Mean *string `locationName:"mean" type:"string"`
471
472	// The minimum value found in the specified field in the result set.
473	//
474	// If the field is numeric (int, int-array, double, or double-array), min is
475	// the string representation of a double-precision 64-bit floating point value.
476	// If the field is date or date-array, min is the string representation of a
477	// date with the format specified in IETF RFC3339 (http://tools.ietf.org/html/rfc3339):
478	// yyyy-mm-ddTHH:mm:ss.SSSZ.
479	Min *string `locationName:"min" type:"string"`
480
481	// The number of documents that do not contain a value in the specified field
482	// in the result set.
483	Missing *int64 `locationName:"missing" type:"long"`
484
485	// The standard deviation of the values in the specified field in the result
486	// set.
487	Stddev *float64 `locationName:"stddev" type:"double"`
488
489	// The sum of the field values across the documents in the result set. null
490	// for date fields.
491	Sum *float64 `locationName:"sum" type:"double"`
492
493	// The sum of all field values in the result set squared.
494	SumOfSquares *float64 `locationName:"sumOfSquares" type:"double"`
495}
496
497// String returns the string representation
498func (s FieldStats) String() string {
499	return awsutil.Prettify(s)
500}
501
502// GoString returns the string representation
503func (s FieldStats) GoString() string {
504	return s.String()
505}
506
507// SetCount sets the Count field's value.
508func (s *FieldStats) SetCount(v int64) *FieldStats {
509	s.Count = &v
510	return s
511}
512
513// SetMax sets the Max field's value.
514func (s *FieldStats) SetMax(v string) *FieldStats {
515	s.Max = &v
516	return s
517}
518
519// SetMean sets the Mean field's value.
520func (s *FieldStats) SetMean(v string) *FieldStats {
521	s.Mean = &v
522	return s
523}
524
525// SetMin sets the Min field's value.
526func (s *FieldStats) SetMin(v string) *FieldStats {
527	s.Min = &v
528	return s
529}
530
531// SetMissing sets the Missing field's value.
532func (s *FieldStats) SetMissing(v int64) *FieldStats {
533	s.Missing = &v
534	return s
535}
536
537// SetStddev sets the Stddev field's value.
538func (s *FieldStats) SetStddev(v float64) *FieldStats {
539	s.Stddev = &v
540	return s
541}
542
543// SetSum sets the Sum field's value.
544func (s *FieldStats) SetSum(v float64) *FieldStats {
545	s.Sum = &v
546	return s
547}
548
549// SetSumOfSquares sets the SumOfSquares field's value.
550func (s *FieldStats) SetSumOfSquares(v float64) *FieldStats {
551	s.SumOfSquares = &v
552	return s
553}
554
555// Information about a document that matches the search request.
556type Hit struct {
557	_ struct{} `type:"structure"`
558
559	// The expressions returned from a document that matches the search request.
560	Exprs map[string]*string `locationName:"exprs" type:"map"`
561
562	// The fields returned from a document that matches the search request.
563	Fields map[string][]*string `locationName:"fields" type:"map"`
564
565	// The highlights returned from a document that matches the search request.
566	Highlights map[string]*string `locationName:"highlights" type:"map"`
567
568	// The document ID of a document that matches the search request.
569	Id *string `locationName:"id" type:"string"`
570}
571
572// String returns the string representation
573func (s Hit) String() string {
574	return awsutil.Prettify(s)
575}
576
577// GoString returns the string representation
578func (s Hit) GoString() string {
579	return s.String()
580}
581
582// SetExprs sets the Exprs field's value.
583func (s *Hit) SetExprs(v map[string]*string) *Hit {
584	s.Exprs = v
585	return s
586}
587
588// SetFields sets the Fields field's value.
589func (s *Hit) SetFields(v map[string][]*string) *Hit {
590	s.Fields = v
591	return s
592}
593
594// SetHighlights sets the Highlights field's value.
595func (s *Hit) SetHighlights(v map[string]*string) *Hit {
596	s.Highlights = v
597	return s
598}
599
600// SetId sets the Id field's value.
601func (s *Hit) SetId(v string) *Hit {
602	s.Id = &v
603	return s
604}
605
606// The collection of documents that match the search request.
607type Hits struct {
608	_ struct{} `type:"structure"`
609
610	// A cursor that can be used to retrieve the next set of matching documents
611	// when you want to page through a large result set.
612	Cursor *string `locationName:"cursor" type:"string"`
613
614	// The total number of documents that match the search request.
615	Found *int64 `locationName:"found" type:"long"`
616
617	// A document that matches the search request.
618	Hit []*Hit `locationName:"hit" type:"list"`
619
620	// The index of the first matching document.
621	Start *int64 `locationName:"start" type:"long"`
622}
623
624// String returns the string representation
625func (s Hits) String() string {
626	return awsutil.Prettify(s)
627}
628
629// GoString returns the string representation
630func (s Hits) GoString() string {
631	return s.String()
632}
633
634// SetCursor sets the Cursor field's value.
635func (s *Hits) SetCursor(v string) *Hits {
636	s.Cursor = &v
637	return s
638}
639
640// SetFound sets the Found field's value.
641func (s *Hits) SetFound(v int64) *Hits {
642	s.Found = &v
643	return s
644}
645
646// SetHit sets the Hit field's value.
647func (s *Hits) SetHit(v []*Hit) *Hits {
648	s.Hit = v
649	return s
650}
651
652// SetStart sets the Start field's value.
653func (s *Hits) SetStart(v int64) *Hits {
654	s.Start = &v
655	return s
656}
657
658// Information about any problems encountered while processing a search request.
659type SearchException struct {
660	_            struct{}                  `type:"structure"`
661	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
662
663	// A description of the error returned by the search service.
664	Message_ *string `locationName:"message" type:"string"`
665}
666
667// String returns the string representation
668func (s SearchException) String() string {
669	return awsutil.Prettify(s)
670}
671
672// GoString returns the string representation
673func (s SearchException) GoString() string {
674	return s.String()
675}
676
677func newErrorSearchException(v protocol.ResponseMetadata) error {
678	return &SearchException{
679		RespMetadata: v,
680	}
681}
682
683// Code returns the exception type name.
684func (s *SearchException) Code() string {
685	return "SearchException"
686}
687
688// Message returns the exception's message.
689func (s *SearchException) Message() string {
690	if s.Message_ != nil {
691		return *s.Message_
692	}
693	return ""
694}
695
696// OrigErr always returns nil, satisfies awserr.Error interface.
697func (s *SearchException) OrigErr() error {
698	return nil
699}
700
701func (s *SearchException) Error() string {
702	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
703}
704
705// Status code returns the HTTP status code for the request's response error.
706func (s *SearchException) StatusCode() int {
707	return s.RespMetadata.StatusCode
708}
709
710// RequestID returns the service's response RequestID for request.
711func (s *SearchException) RequestID() string {
712	return s.RespMetadata.RequestID
713}
714
715// Container for the parameters to the Search request.
716type SearchInput struct {
717	_ struct{} `type:"structure"`
718
719	// Retrieves a cursor value you can use to page through large result sets. Use
720	// the size parameter to control the number of hits to include in each response.
721	// You can specify either the cursor or start parameter in a request; they are
722	// mutually exclusive. To get the first cursor, set the cursor value to initial.
723	// In subsequent requests, specify the cursor value returned in the hits section
724	// of the response.
725	//
726	// For more information, see Paginating Results (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/paginating-results.html)
727	// in the Amazon CloudSearch Developer Guide.
728	Cursor *string `location:"querystring" locationName:"cursor" type:"string"`
729
730	// Defines one or more numeric expressions that can be used to sort results
731	// or specify search or filter criteria. You can also specify expressions as
732	// return fields.
733	//
734	// You specify the expressions in JSON using the form {"EXPRESSIONNAME":"EXPRESSION"}.
735	// You can define and use multiple expressions in a search request. For example:
736	//
737	// {"expression1":"_score*rating", "expression2":"(1/rank)*year"}
738	//
739	// For information about the variables, operators, and functions you can use
740	// in expressions, see Writing Expressions (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-expressions.html#writing-expressions)
741	// in the Amazon CloudSearch Developer Guide.
742	Expr *string `location:"querystring" locationName:"expr" type:"string"`
743
744	// Specifies one or more fields for which to get facet information, and options
745	// that control how the facet information is returned. Each specified field
746	// must be facet-enabled in the domain configuration. The fields and options
747	// are specified in JSON using the form {"FIELD":{"OPTION":VALUE,"OPTION:"STRING"},"FIELD":{"OPTION":VALUE,"OPTION":"STRING"}}.
748	//
749	// You can specify the following faceting options:
750	//
751	//    * buckets specifies an array of the facet values or ranges to count. Ranges
752	//    are specified using the same syntax that you use to search for a range
753	//    of values. For more information, see Searching for a Range of Values (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-ranges.html)
754	//    in the Amazon CloudSearch Developer Guide. Buckets are returned in the
755	//    order they are specified in the request. The sort and size options are
756	//    not valid if you specify buckets.
757	//
758	//    * size specifies the maximum number of facets to include in the results.
759	//    By default, Amazon CloudSearch returns counts for the top 10. The size
760	//    parameter is only valid when you specify the sort option; it cannot be
761	//    used in conjunction with buckets.
762	//
763	//    * sort specifies how you want to sort the facets in the results: bucket
764	//    or count. Specify bucket to sort alphabetically or numerically by facet
765	//    value (in ascending order). Specify count to sort by the facet counts
766	//    computed for each facet value (in descending order). To retrieve facet
767	//    counts for particular values or ranges of values, use the buckets option
768	//    instead of sort.
769	//
770	// If no facet options are specified, facet counts are computed for all field
771	// values, the facets are sorted by facet count, and the top 10 facets are returned
772	// in the results.
773	//
774	// To count particular buckets of values, use the buckets option. For example,
775	// the following request uses the buckets option to calculate and return facet
776	// counts by decade.
777	//
778	// {"year":{"buckets":["[1970,1979]","[1980,1989]","[1990,1999]","[2000,2009]","[2010,}"]}}
779	//
780	// To sort facets by facet count, use the count option. For example, the following
781	// request sets the sort option to count to sort the facet values by facet count,
782	// with the facet values that have the most matching documents listed first.
783	// Setting the size option to 3 returns only the top three facet values.
784	//
785	// {"year":{"sort":"count","size":3}}
786	//
787	// To sort the facets by value, use the bucket option. For example, the following
788	// request sets the sort option to bucket to sort the facet values numerically
789	// by year, with earliest year listed first.
790	//
791	// {"year":{"sort":"bucket"}}
792	//
793	// For more information, see Getting and Using Facet Information (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/faceting.html)
794	// in the Amazon CloudSearch Developer Guide.
795	Facet *string `location:"querystring" locationName:"facet" type:"string"`
796
797	// Specifies a structured query that filters the results of a search without
798	// affecting how the results are scored and sorted. You use filterQuery in conjunction
799	// with the query parameter to filter the documents that match the constraints
800	// specified in the query parameter. Specifying a filter controls only which
801	// matching documents are included in the results, it has no effect on how they
802	// are scored and sorted. The filterQuery parameter supports the full structured
803	// query syntax.
804	//
805	// For more information about using filters, see Filtering Matching Documents
806	// (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/filtering-results.html)
807	// in the Amazon CloudSearch Developer Guide.
808	FilterQuery *string `location:"querystring" locationName:"fq" type:"string"`
809
810	// Retrieves highlights for matches in the specified text or text-array fields.
811	// Each specified field must be highlight enabled in the domain configuration.
812	// The fields and options are specified in JSON using the form {"FIELD":{"OPTION":VALUE,"OPTION:"STRING"},"FIELD":{"OPTION":VALUE,"OPTION":"STRING"}}.
813	//
814	// You can specify the following highlight options:
815	//
816	//    * format: specifies the format of the data in the text field: text or
817	//    html. When data is returned as HTML, all non-alphanumeric characters are
818	//    encoded. The default is html.
819	//
820	//    * max_phrases: specifies the maximum number of occurrences of the search
821	//    term(s) you want to highlight. By default, the first occurrence is highlighted.
822	//
823	//    * pre_tag: specifies the string to prepend to an occurrence of a search
824	//    term. The default for HTML highlights is <em>. The default for text
825	//    highlights is *.
826	//
827	//    * post_tag: specifies the string to append to an occurrence of a search
828	//    term. The default for HTML highlights is </em>. The default for
829	//    text highlights is *.
830	//
831	// If no highlight options are specified for a field, the returned field text
832	// is treated as HTML and the first match is highlighted with emphasis tags:
833	// <em>search-term</em>.
834	//
835	// For example, the following request retrieves highlights for the actors and
836	// title fields.
837	//
838	// { "actors": {}, "title": {"format": "text","max_phrases": 2,"pre_tag": "","post_tag":
839	// ""} }
840	Highlight *string `location:"querystring" locationName:"highlight" type:"string"`
841
842	// Enables partial results to be returned if one or more index partitions are
843	// unavailable. When your search index is partitioned across multiple search
844	// instances, by default Amazon CloudSearch only returns results if every partition
845	// can be queried. This means that the failure of a single search instance can
846	// result in 5xx (internal server) errors. When you enable partial results,
847	// Amazon CloudSearch returns whatever results are available and includes the
848	// percentage of documents searched in the search results (percent-searched).
849	// This enables you to more gracefully degrade your users' search experience.
850	// For example, rather than displaying no results, you could display the partial
851	// results and a message indicating that the results might be incomplete due
852	// to a temporary system outage.
853	Partial *bool `location:"querystring" locationName:"partial" type:"boolean"`
854
855	// Specifies the search criteria for the request. How you specify the search
856	// criteria depends on the query parser used for the request and the parser
857	// options specified in the queryOptions parameter. By default, the simple query
858	// parser is used to process requests. To use the structured, lucene, or dismax
859	// query parser, you must also specify the queryParser parameter.
860	//
861	// For more information about specifying search criteria, see Searching Your
862	// Data (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching.html)
863	// in the Amazon CloudSearch Developer Guide.
864	//
865	// Query is a required field
866	Query *string `location:"querystring" locationName:"q" type:"string" required:"true"`
867
868	// Configures options for the query parser specified in the queryParser parameter.
869	// You specify the options in JSON using the following form {"OPTION1":"VALUE1","OPTION2":VALUE2"..."OPTIONN":"VALUEN"}.
870	//
871	// The options you can configure vary according to which parser you use:
872	//
873	//    * defaultOperator: The default operator used to combine individual terms
874	//    in the search string. For example: defaultOperator: 'or'. For the dismax
875	//    parser, you specify a percentage that represents the percentage of terms
876	//    in the search string (rounded down) that must match, rather than a default
877	//    operator. A value of 0% is the equivalent to OR, and a value of 100% is
878	//    equivalent to AND. The percentage must be specified as a value in the
879	//    range 0-100 followed by the percent (%) symbol. For example, defaultOperator:
880	//    50%. Valid values: and, or, a percentage in the range 0%-100% (dismax).
881	//    Default: and (simple, structured, lucene) or 100 (dismax). Valid for:
882	//    simple, structured, lucene, and dismax.
883	//
884	//    * fields: An array of the fields to search when no fields are specified
885	//    in a search. If no fields are specified in a search and this option is
886	//    not specified, all text and text-array fields are searched. You can specify
887	//    a weight for each field to control the relative importance of each field
888	//    when Amazon CloudSearch calculates relevance scores. To specify a field
889	//    weight, append a caret (^) symbol and the weight to the field name. For
890	//    example, to boost the importance of the title field over the description
891	//    field you could specify: "fields":["title^5","description"]. Valid values:
892	//    The name of any configured field and an optional numeric value greater
893	//    than zero. Default: All text and text-array fields. Valid for: simple,
894	//    structured, lucene, and dismax.
895	//
896	//    * operators: An array of the operators or special characters you want
897	//    to disable for the simple query parser. If you disable the and, or, or
898	//    not operators, the corresponding operators (+, |, -) have no special meaning
899	//    and are dropped from the search string. Similarly, disabling prefix disables
900	//    the wildcard operator (*) and disabling phrase disables the ability to
901	//    search for phrases by enclosing phrases in double quotes. Disabling precedence
902	//    disables the ability to control order of precedence using parentheses.
903	//    Disabling near disables the ability to use the ~ operator to perform a
904	//    sloppy phrase search. Disabling the fuzzy operator disables the ability
905	//    to use the ~ operator to perform a fuzzy search. escape disables the ability
906	//    to use a backslash (\) to escape special characters within the search
907	//    string. Disabling whitespace is an advanced option that prevents the parser
908	//    from tokenizing on whitespace, which can be useful for Vietnamese. (It
909	//    prevents Vietnamese words from being split incorrectly.) For example,
910	//    you could disable all operators other than the phrase operator to support
911	//    just simple term and phrase queries: "operators":["and","not","or", "prefix"].
912	//    Valid values: and, escape, fuzzy, near, not, or, phrase, precedence, prefix,
913	//    whitespace. Default: All operators and special characters are enabled.
914	//    Valid for: simple.
915	//
916	//    * phraseFields: An array of the text or text-array fields you want to
917	//    use for phrase searches. When the terms in the search string appear in
918	//    close proximity within a field, the field scores higher. You can specify
919	//    a weight for each field to boost that score. The phraseSlop option controls
920	//    how much the matches can deviate from the search string and still be boosted.
921	//    To specify a field weight, append a caret (^) symbol and the weight to
922	//    the field name. For example, to boost phrase matches in the title field
923	//    over the abstract field, you could specify: "phraseFields":["title^3",
924	//    "plot"] Valid values: The name of any text or text-array field and an
925	//    optional numeric value greater than zero. Default: No fields. If you don't
926	//    specify any fields with phraseFields, proximity scoring is disabled even
927	//    if phraseSlop is specified. Valid for: dismax.
928	//
929	//    * phraseSlop: An integer value that specifies how much matches can deviate
930	//    from the search phrase and still be boosted according to the weights specified
931	//    in the phraseFields option; for example, phraseSlop: 2. You must also
932	//    specify phraseFields to enable proximity scoring. Valid values: positive
933	//    integers. Default: 0. Valid for: dismax.
934	//
935	//    * explicitPhraseSlop: An integer value that specifies how much a match
936	//    can deviate from the search phrase when the phrase is enclosed in double
937	//    quotes in the search string. (Phrases that exceed this proximity distance
938	//    are not considered a match.) For example, to specify a slop of three for
939	//    dismax phrase queries, you would specify "explicitPhraseSlop":3. Valid
940	//    values: positive integers. Default: 0. Valid for: dismax.
941	//
942	//    * tieBreaker: When a term in the search string is found in a document's
943	//    field, a score is calculated for that field based on how common the word
944	//    is in that field compared to other documents. If the term occurs in multiple
945	//    fields within a document, by default only the highest scoring field contributes
946	//    to the document's overall score. You can specify a tieBreaker value to
947	//    enable the matches in lower-scoring fields to contribute to the document's
948	//    score. That way, if two documents have the same max field score for a
949	//    particular term, the score for the document that has matches in more fields
950	//    will be higher. The formula for calculating the score with a tieBreaker
951	//    is (max field score) + (tieBreaker) * (sum of the scores for the rest
952	//    of the matching fields). Set tieBreaker to 0 to disregard all but the
953	//    highest scoring field (pure max): "tieBreaker":0. Set to 1 to sum the
954	//    scores from all fields (pure sum): "tieBreaker":1. Valid values: 0.0 to
955	//    1.0. Default: 0.0. Valid for: dismax.
956	QueryOptions *string `location:"querystring" locationName:"q.options" type:"string"`
957
958	// Specifies which query parser to use to process the request. If queryParser
959	// is not specified, Amazon CloudSearch uses the simple query parser.
960	//
961	// Amazon CloudSearch supports four query parsers:
962	//
963	//    * simple: perform simple searches of text and text-array fields. By default,
964	//    the simple query parser searches all text and text-array fields. You can
965	//    specify which fields to search by with the queryOptions parameter. If
966	//    you prefix a search term with a plus sign (+) documents must contain the
967	//    term to be considered a match. (This is the default, unless you configure
968	//    the default operator with the queryOptions parameter.) You can use the
969	//    - (NOT), | (OR), and * (wildcard) operators to exclude particular terms,
970	//    find results that match any of the specified terms, or search for a prefix.
971	//    To search for a phrase rather than individual terms, enclose the phrase
972	//    in double quotes. For more information, see Searching for Text in the
973	//    Amazon CloudSearch Developer Guide.
974	//
975	//    * structured: perform advanced searches by combining multiple expressions
976	//    to define the search criteria. You can also search within particular fields,
977	//    search for values and ranges of values, and use advanced options such
978	//    as term boosting, matchall, and near. For more information, see Constructing
979	//    Compound Queries in the Amazon CloudSearch Developer Guide.
980	//
981	//    * lucene: search using the Apache Lucene query parser syntax. For more
982	//    information, see Apache Lucene Query Parser Syntax.
983	//
984	//    * dismax: search using the simplified subset of the Apache Lucene query
985	//    parser syntax defined by the DisMax query parser. For more information,
986	//    see DisMax Query Parser Syntax.
987	QueryParser *string `location:"querystring" locationName:"q.parser" type:"string" enum:"QueryParser"`
988
989	// Specifies the field and expression values to include in the response. Multiple
990	// fields or expressions are specified as a comma-separated list. By default,
991	// a search response includes all return enabled fields (_all_fields). To return
992	// only the document IDs for the matching documents, specify _no_fields. To
993	// retrieve the relevance score calculated for each document, specify _score.
994	Return *string `location:"querystring" locationName:"return" type:"string"`
995
996	// Specifies the maximum number of search hits to include in the response.
997	Size *int64 `location:"querystring" locationName:"size" type:"long"`
998
999	// Specifies the fields or custom expressions to use to sort the search results.
1000	// Multiple fields or expressions are specified as a comma-separated list. You
1001	// must specify the sort direction (asc or desc) for each field; for example,
1002	// year desc,title asc. To use a field to sort results, the field must be sort-enabled
1003	// in the domain configuration. Array type fields cannot be used for sorting.
1004	// If no sort parameter is specified, results are sorted by their default relevance
1005	// scores in descending order: _score desc. You can also sort by document ID
1006	// (_id asc) and version (_version desc).
1007	//
1008	// For more information, see Sorting Results (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/sorting-results.html)
1009	// in the Amazon CloudSearch Developer Guide.
1010	Sort *string `location:"querystring" locationName:"sort" type:"string"`
1011
1012	// Specifies the offset of the first search hit you want to return. Note that
1013	// the result set is zero-based; the first result is at index 0. You can specify
1014	// either the start or cursor parameter in a request, they are mutually exclusive.
1015	//
1016	// For more information, see Paginating Results (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/paginating-results.html)
1017	// in the Amazon CloudSearch Developer Guide.
1018	Start *int64 `location:"querystring" locationName:"start" type:"long"`
1019
1020	// Specifies one or more fields for which to get statistics information. Each
1021	// specified field must be facet-enabled in the domain configuration. The fields
1022	// are specified in JSON using the form:
1023	//
1024	//    {"FIELD-A":{},"FIELD-B":{}}
1025	//
1026	// There are currently no options supported for statistics.
1027	Stats *string `location:"querystring" locationName:"stats" type:"string"`
1028}
1029
1030// String returns the string representation
1031func (s SearchInput) String() string {
1032	return awsutil.Prettify(s)
1033}
1034
1035// GoString returns the string representation
1036func (s SearchInput) GoString() string {
1037	return s.String()
1038}
1039
1040// Validate inspects the fields of the type to determine if they are valid.
1041func (s *SearchInput) Validate() error {
1042	invalidParams := request.ErrInvalidParams{Context: "SearchInput"}
1043	if s.Query == nil {
1044		invalidParams.Add(request.NewErrParamRequired("Query"))
1045	}
1046
1047	if invalidParams.Len() > 0 {
1048		return invalidParams
1049	}
1050	return nil
1051}
1052
1053// SetCursor sets the Cursor field's value.
1054func (s *SearchInput) SetCursor(v string) *SearchInput {
1055	s.Cursor = &v
1056	return s
1057}
1058
1059// SetExpr sets the Expr field's value.
1060func (s *SearchInput) SetExpr(v string) *SearchInput {
1061	s.Expr = &v
1062	return s
1063}
1064
1065// SetFacet sets the Facet field's value.
1066func (s *SearchInput) SetFacet(v string) *SearchInput {
1067	s.Facet = &v
1068	return s
1069}
1070
1071// SetFilterQuery sets the FilterQuery field's value.
1072func (s *SearchInput) SetFilterQuery(v string) *SearchInput {
1073	s.FilterQuery = &v
1074	return s
1075}
1076
1077// SetHighlight sets the Highlight field's value.
1078func (s *SearchInput) SetHighlight(v string) *SearchInput {
1079	s.Highlight = &v
1080	return s
1081}
1082
1083// SetPartial sets the Partial field's value.
1084func (s *SearchInput) SetPartial(v bool) *SearchInput {
1085	s.Partial = &v
1086	return s
1087}
1088
1089// SetQuery sets the Query field's value.
1090func (s *SearchInput) SetQuery(v string) *SearchInput {
1091	s.Query = &v
1092	return s
1093}
1094
1095// SetQueryOptions sets the QueryOptions field's value.
1096func (s *SearchInput) SetQueryOptions(v string) *SearchInput {
1097	s.QueryOptions = &v
1098	return s
1099}
1100
1101// SetQueryParser sets the QueryParser field's value.
1102func (s *SearchInput) SetQueryParser(v string) *SearchInput {
1103	s.QueryParser = &v
1104	return s
1105}
1106
1107// SetReturn sets the Return field's value.
1108func (s *SearchInput) SetReturn(v string) *SearchInput {
1109	s.Return = &v
1110	return s
1111}
1112
1113// SetSize sets the Size field's value.
1114func (s *SearchInput) SetSize(v int64) *SearchInput {
1115	s.Size = &v
1116	return s
1117}
1118
1119// SetSort sets the Sort field's value.
1120func (s *SearchInput) SetSort(v string) *SearchInput {
1121	s.Sort = &v
1122	return s
1123}
1124
1125// SetStart sets the Start field's value.
1126func (s *SearchInput) SetStart(v int64) *SearchInput {
1127	s.Start = &v
1128	return s
1129}
1130
1131// SetStats sets the Stats field's value.
1132func (s *SearchInput) SetStats(v string) *SearchInput {
1133	s.Stats = &v
1134	return s
1135}
1136
1137// The result of a Search request. Contains the documents that match the specified
1138// search criteria and any requested fields, highlights, and facet information.
1139type SearchOutput struct {
1140	_ struct{} `type:"structure"`
1141
1142	// The requested facet information.
1143	Facets map[string]*BucketInfo `locationName:"facets" type:"map"`
1144
1145	// The documents that match the search criteria.
1146	Hits *Hits `locationName:"hits" type:"structure"`
1147
1148	// The requested field statistics information.
1149	Stats map[string]*FieldStats `locationName:"stats" type:"map"`
1150
1151	// The status information returned for the search request.
1152	Status *SearchStatus `locationName:"status" type:"structure"`
1153}
1154
1155// String returns the string representation
1156func (s SearchOutput) String() string {
1157	return awsutil.Prettify(s)
1158}
1159
1160// GoString returns the string representation
1161func (s SearchOutput) GoString() string {
1162	return s.String()
1163}
1164
1165// SetFacets sets the Facets field's value.
1166func (s *SearchOutput) SetFacets(v map[string]*BucketInfo) *SearchOutput {
1167	s.Facets = v
1168	return s
1169}
1170
1171// SetHits sets the Hits field's value.
1172func (s *SearchOutput) SetHits(v *Hits) *SearchOutput {
1173	s.Hits = v
1174	return s
1175}
1176
1177// SetStats sets the Stats field's value.
1178func (s *SearchOutput) SetStats(v map[string]*FieldStats) *SearchOutput {
1179	s.Stats = v
1180	return s
1181}
1182
1183// SetStatus sets the Status field's value.
1184func (s *SearchOutput) SetStatus(v *SearchStatus) *SearchOutput {
1185	s.Status = v
1186	return s
1187}
1188
1189// Contains the resource id (rid) and the time it took to process the request
1190// (timems).
1191type SearchStatus struct {
1192	_ struct{} `type:"structure"`
1193
1194	// The encrypted resource ID for the request.
1195	Rid *string `locationName:"rid" type:"string"`
1196
1197	// How long it took to process the request, in milliseconds.
1198	Timems *int64 `locationName:"timems" type:"long"`
1199}
1200
1201// String returns the string representation
1202func (s SearchStatus) String() string {
1203	return awsutil.Prettify(s)
1204}
1205
1206// GoString returns the string representation
1207func (s SearchStatus) GoString() string {
1208	return s.String()
1209}
1210
1211// SetRid sets the Rid field's value.
1212func (s *SearchStatus) SetRid(v string) *SearchStatus {
1213	s.Rid = &v
1214	return s
1215}
1216
1217// SetTimems sets the Timems field's value.
1218func (s *SearchStatus) SetTimems(v int64) *SearchStatus {
1219	s.Timems = &v
1220	return s
1221}
1222
1223// Container for the parameters to the Suggest request.
1224type SuggestInput struct {
1225	_ struct{} `type:"structure"`
1226
1227	// Specifies the string for which you want to get suggestions.
1228	//
1229	// Query is a required field
1230	Query *string `location:"querystring" locationName:"q" type:"string" required:"true"`
1231
1232	// Specifies the maximum number of suggestions to return.
1233	Size *int64 `location:"querystring" locationName:"size" type:"long"`
1234
1235	// Specifies the name of the suggester to use to find suggested matches.
1236	//
1237	// Suggester is a required field
1238	Suggester *string `location:"querystring" locationName:"suggester" type:"string" required:"true"`
1239}
1240
1241// String returns the string representation
1242func (s SuggestInput) String() string {
1243	return awsutil.Prettify(s)
1244}
1245
1246// GoString returns the string representation
1247func (s SuggestInput) GoString() string {
1248	return s.String()
1249}
1250
1251// Validate inspects the fields of the type to determine if they are valid.
1252func (s *SuggestInput) Validate() error {
1253	invalidParams := request.ErrInvalidParams{Context: "SuggestInput"}
1254	if s.Query == nil {
1255		invalidParams.Add(request.NewErrParamRequired("Query"))
1256	}
1257	if s.Suggester == nil {
1258		invalidParams.Add(request.NewErrParamRequired("Suggester"))
1259	}
1260
1261	if invalidParams.Len() > 0 {
1262		return invalidParams
1263	}
1264	return nil
1265}
1266
1267// SetQuery sets the Query field's value.
1268func (s *SuggestInput) SetQuery(v string) *SuggestInput {
1269	s.Query = &v
1270	return s
1271}
1272
1273// SetSize sets the Size field's value.
1274func (s *SuggestInput) SetSize(v int64) *SuggestInput {
1275	s.Size = &v
1276	return s
1277}
1278
1279// SetSuggester sets the Suggester field's value.
1280func (s *SuggestInput) SetSuggester(v string) *SuggestInput {
1281	s.Suggester = &v
1282	return s
1283}
1284
1285// Container for the suggestion information returned in a SuggestResponse.
1286type SuggestModel struct {
1287	_ struct{} `type:"structure"`
1288
1289	// The number of documents that were found to match the query string.
1290	Found *int64 `locationName:"found" type:"long"`
1291
1292	// The query string specified in the suggest request.
1293	Query *string `locationName:"query" type:"string"`
1294
1295	// The documents that match the query string.
1296	Suggestions []*SuggestionMatch `locationName:"suggestions" type:"list"`
1297}
1298
1299// String returns the string representation
1300func (s SuggestModel) String() string {
1301	return awsutil.Prettify(s)
1302}
1303
1304// GoString returns the string representation
1305func (s SuggestModel) GoString() string {
1306	return s.String()
1307}
1308
1309// SetFound sets the Found field's value.
1310func (s *SuggestModel) SetFound(v int64) *SuggestModel {
1311	s.Found = &v
1312	return s
1313}
1314
1315// SetQuery sets the Query field's value.
1316func (s *SuggestModel) SetQuery(v string) *SuggestModel {
1317	s.Query = &v
1318	return s
1319}
1320
1321// SetSuggestions sets the Suggestions field's value.
1322func (s *SuggestModel) SetSuggestions(v []*SuggestionMatch) *SuggestModel {
1323	s.Suggestions = v
1324	return s
1325}
1326
1327// Contains the response to a Suggest request.
1328type SuggestOutput struct {
1329	_ struct{} `type:"structure"`
1330
1331	// The status of a SuggestRequest. Contains the resource ID (rid) and how long
1332	// it took to process the request (timems).
1333	Status *SuggestStatus `locationName:"status" type:"structure"`
1334
1335	// Container for the matching search suggestion information.
1336	Suggest *SuggestModel `locationName:"suggest" type:"structure"`
1337}
1338
1339// String returns the string representation
1340func (s SuggestOutput) String() string {
1341	return awsutil.Prettify(s)
1342}
1343
1344// GoString returns the string representation
1345func (s SuggestOutput) GoString() string {
1346	return s.String()
1347}
1348
1349// SetStatus sets the Status field's value.
1350func (s *SuggestOutput) SetStatus(v *SuggestStatus) *SuggestOutput {
1351	s.Status = v
1352	return s
1353}
1354
1355// SetSuggest sets the Suggest field's value.
1356func (s *SuggestOutput) SetSuggest(v *SuggestModel) *SuggestOutput {
1357	s.Suggest = v
1358	return s
1359}
1360
1361// Contains the resource id (rid) and the time it took to process the request
1362// (timems).
1363type SuggestStatus struct {
1364	_ struct{} `type:"structure"`
1365
1366	// The encrypted resource ID for the request.
1367	Rid *string `locationName:"rid" type:"string"`
1368
1369	// How long it took to process the request, in milliseconds.
1370	Timems *int64 `locationName:"timems" type:"long"`
1371}
1372
1373// String returns the string representation
1374func (s SuggestStatus) String() string {
1375	return awsutil.Prettify(s)
1376}
1377
1378// GoString returns the string representation
1379func (s SuggestStatus) GoString() string {
1380	return s.String()
1381}
1382
1383// SetRid sets the Rid field's value.
1384func (s *SuggestStatus) SetRid(v string) *SuggestStatus {
1385	s.Rid = &v
1386	return s
1387}
1388
1389// SetTimems sets the Timems field's value.
1390func (s *SuggestStatus) SetTimems(v int64) *SuggestStatus {
1391	s.Timems = &v
1392	return s
1393}
1394
1395// An autocomplete suggestion that matches the query string specified in a SuggestRequest.
1396type SuggestionMatch struct {
1397	_ struct{} `type:"structure"`
1398
1399	// The document ID of the suggested document.
1400	Id *string `locationName:"id" type:"string"`
1401
1402	// The relevance score of a suggested match.
1403	Score *int64 `locationName:"score" type:"long"`
1404
1405	// The string that matches the query string specified in the SuggestRequest.
1406	Suggestion *string `locationName:"suggestion" type:"string"`
1407}
1408
1409// String returns the string representation
1410func (s SuggestionMatch) String() string {
1411	return awsutil.Prettify(s)
1412}
1413
1414// GoString returns the string representation
1415func (s SuggestionMatch) GoString() string {
1416	return s.String()
1417}
1418
1419// SetId sets the Id field's value.
1420func (s *SuggestionMatch) SetId(v string) *SuggestionMatch {
1421	s.Id = &v
1422	return s
1423}
1424
1425// SetScore sets the Score field's value.
1426func (s *SuggestionMatch) SetScore(v int64) *SuggestionMatch {
1427	s.Score = &v
1428	return s
1429}
1430
1431// SetSuggestion sets the Suggestion field's value.
1432func (s *SuggestionMatch) SetSuggestion(v string) *SuggestionMatch {
1433	s.Suggestion = &v
1434	return s
1435}
1436
1437// Container for the parameters to the UploadDocuments request.
1438type UploadDocumentsInput struct {
1439	_ struct{} `type:"structure" payload:"Documents"`
1440
1441	// The format of the batch you are uploading. Amazon CloudSearch supports two
1442	// document batch formats:
1443	//
1444	//    * application/json
1445	//
1446	//    * application/xml
1447	//
1448	// ContentType is a required field
1449	ContentType *string `location:"header" locationName:"Content-Type" type:"string" required:"true" enum:"ContentType"`
1450
1451	// A batch of documents formatted in JSON or HTML.
1452	//
1453	// Documents is a required field
1454	Documents io.ReadSeeker `locationName:"documents" type:"blob" required:"true"`
1455}
1456
1457// String returns the string representation
1458func (s UploadDocumentsInput) String() string {
1459	return awsutil.Prettify(s)
1460}
1461
1462// GoString returns the string representation
1463func (s UploadDocumentsInput) GoString() string {
1464	return s.String()
1465}
1466
1467// Validate inspects the fields of the type to determine if they are valid.
1468func (s *UploadDocumentsInput) Validate() error {
1469	invalidParams := request.ErrInvalidParams{Context: "UploadDocumentsInput"}
1470	if s.ContentType == nil {
1471		invalidParams.Add(request.NewErrParamRequired("ContentType"))
1472	}
1473	if s.Documents == nil {
1474		invalidParams.Add(request.NewErrParamRequired("Documents"))
1475	}
1476
1477	if invalidParams.Len() > 0 {
1478		return invalidParams
1479	}
1480	return nil
1481}
1482
1483// SetContentType sets the ContentType field's value.
1484func (s *UploadDocumentsInput) SetContentType(v string) *UploadDocumentsInput {
1485	s.ContentType = &v
1486	return s
1487}
1488
1489// SetDocuments sets the Documents field's value.
1490func (s *UploadDocumentsInput) SetDocuments(v io.ReadSeeker) *UploadDocumentsInput {
1491	s.Documents = v
1492	return s
1493}
1494
1495// Contains the response to an UploadDocuments request.
1496type UploadDocumentsOutput struct {
1497	_ struct{} `type:"structure"`
1498
1499	// The number of documents that were added to the search domain.
1500	Adds *int64 `locationName:"adds" type:"long"`
1501
1502	// The number of documents that were deleted from the search domain.
1503	Deletes *int64 `locationName:"deletes" type:"long"`
1504
1505	// The status of an UploadDocumentsRequest.
1506	Status *string `locationName:"status" type:"string"`
1507
1508	// Any warnings returned by the document service about the documents being uploaded.
1509	Warnings []*DocumentServiceWarning `locationName:"warnings" type:"list"`
1510}
1511
1512// String returns the string representation
1513func (s UploadDocumentsOutput) String() string {
1514	return awsutil.Prettify(s)
1515}
1516
1517// GoString returns the string representation
1518func (s UploadDocumentsOutput) GoString() string {
1519	return s.String()
1520}
1521
1522// SetAdds sets the Adds field's value.
1523func (s *UploadDocumentsOutput) SetAdds(v int64) *UploadDocumentsOutput {
1524	s.Adds = &v
1525	return s
1526}
1527
1528// SetDeletes sets the Deletes field's value.
1529func (s *UploadDocumentsOutput) SetDeletes(v int64) *UploadDocumentsOutput {
1530	s.Deletes = &v
1531	return s
1532}
1533
1534// SetStatus sets the Status field's value.
1535func (s *UploadDocumentsOutput) SetStatus(v string) *UploadDocumentsOutput {
1536	s.Status = &v
1537	return s
1538}
1539
1540// SetWarnings sets the Warnings field's value.
1541func (s *UploadDocumentsOutput) SetWarnings(v []*DocumentServiceWarning) *UploadDocumentsOutput {
1542	s.Warnings = v
1543	return s
1544}
1545
1546const (
1547	// ContentTypeApplicationJson is a ContentType enum value
1548	ContentTypeApplicationJson = "application/json"
1549
1550	// ContentTypeApplicationXml is a ContentType enum value
1551	ContentTypeApplicationXml = "application/xml"
1552)
1553
1554// ContentType_Values returns all elements of the ContentType enum
1555func ContentType_Values() []string {
1556	return []string{
1557		ContentTypeApplicationJson,
1558		ContentTypeApplicationXml,
1559	}
1560}
1561
1562const (
1563	// QueryParserSimple is a QueryParser enum value
1564	QueryParserSimple = "simple"
1565
1566	// QueryParserStructured is a QueryParser enum value
1567	QueryParserStructured = "structured"
1568
1569	// QueryParserLucene is a QueryParser enum value
1570	QueryParserLucene = "lucene"
1571
1572	// QueryParserDismax is a QueryParser enum value
1573	QueryParserDismax = "dismax"
1574)
1575
1576// QueryParser_Values returns all elements of the QueryParser enum
1577func QueryParser_Values() []string {
1578	return []string{
1579		QueryParserSimple,
1580		QueryParserStructured,
1581		QueryParserLucene,
1582		QueryParserDismax,
1583	}
1584}
1585