github.com/aavshr/aws-sdk-go@v1.41.3/service/cloudsearchdomain/api.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 package cloudsearchdomain 4 5 import ( 6 "fmt" 7 "io" 8 9 "github.com/aavshr/aws-sdk-go/aws" 10 "github.com/aavshr/aws-sdk-go/aws/awsutil" 11 "github.com/aavshr/aws-sdk-go/aws/request" 12 "github.com/aavshr/aws-sdk-go/private/protocol" 13 ) 14 15 const 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 // } 39 func (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 // 94 func (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. 108 func (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 115 const 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 // } 139 func (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 // 186 func (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. 200 func (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 207 const 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 // } 231 func (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 // 283 func (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. 297 func (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. 305 type 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. 316 // 317 // API parameter values that are decorated as "sensitive" in the API will not 318 // be included in the string output. The member name will be present, but the 319 // value will be replaced with "sensitive". 320 func (s Bucket) String() string { 321 return awsutil.Prettify(s) 322 } 323 324 // GoString returns the string representation. 325 // 326 // API parameter values that are decorated as "sensitive" in the API will not 327 // be included in the string output. The member name will be present, but the 328 // value will be replaced with "sensitive". 329 func (s Bucket) GoString() string { 330 return s.String() 331 } 332 333 // SetCount sets the Count field's value. 334 func (s *Bucket) SetCount(v int64) *Bucket { 335 s.Count = &v 336 return s 337 } 338 339 // SetValue sets the Value field's value. 340 func (s *Bucket) SetValue(v string) *Bucket { 341 s.Value = &v 342 return s 343 } 344 345 // A container for the calculated facet values and counts. 346 type BucketInfo struct { 347 _ struct{} `type:"structure"` 348 349 // A list of the calculated facet values and counts. 350 Buckets []*Bucket `locationName:"buckets" type:"list"` 351 } 352 353 // String returns the string representation. 354 // 355 // API parameter values that are decorated as "sensitive" in the API will not 356 // be included in the string output. The member name will be present, but the 357 // value will be replaced with "sensitive". 358 func (s BucketInfo) String() string { 359 return awsutil.Prettify(s) 360 } 361 362 // GoString returns the string representation. 363 // 364 // API parameter values that are decorated as "sensitive" in the API will not 365 // be included in the string output. The member name will be present, but the 366 // value will be replaced with "sensitive". 367 func (s BucketInfo) GoString() string { 368 return s.String() 369 } 370 371 // SetBuckets sets the Buckets field's value. 372 func (s *BucketInfo) SetBuckets(v []*Bucket) *BucketInfo { 373 s.Buckets = v 374 return s 375 } 376 377 // Information about any problems encountered while processing an upload request. 378 type DocumentServiceException struct { 379 _ struct{} `type:"structure"` 380 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 381 382 // The description of the errors returned by the document service. 383 Message_ *string `locationName:"message" type:"string"` 384 385 // The return status of a document upload request, error or success. 386 Status *string `locationName:"status" type:"string"` 387 } 388 389 // String returns the string representation. 390 // 391 // API parameter values that are decorated as "sensitive" in the API will not 392 // be included in the string output. The member name will be present, but the 393 // value will be replaced with "sensitive". 394 func (s DocumentServiceException) String() string { 395 return awsutil.Prettify(s) 396 } 397 398 // GoString returns the string representation. 399 // 400 // API parameter values that are decorated as "sensitive" in the API will not 401 // be included in the string output. The member name will be present, but the 402 // value will be replaced with "sensitive". 403 func (s DocumentServiceException) GoString() string { 404 return s.String() 405 } 406 407 func newErrorDocumentServiceException(v protocol.ResponseMetadata) error { 408 return &DocumentServiceException{ 409 RespMetadata: v, 410 } 411 } 412 413 // Code returns the exception type name. 414 func (s *DocumentServiceException) Code() string { 415 return "DocumentServiceException" 416 } 417 418 // Message returns the exception's message. 419 func (s *DocumentServiceException) Message() string { 420 if s.Message_ != nil { 421 return *s.Message_ 422 } 423 return "" 424 } 425 426 // OrigErr always returns nil, satisfies awserr.Error interface. 427 func (s *DocumentServiceException) OrigErr() error { 428 return nil 429 } 430 431 func (s *DocumentServiceException) Error() string { 432 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 433 } 434 435 // Status code returns the HTTP status code for the request's response error. 436 func (s *DocumentServiceException) StatusCode() int { 437 return s.RespMetadata.StatusCode 438 } 439 440 // RequestID returns the service's response RequestID for request. 441 func (s *DocumentServiceException) RequestID() string { 442 return s.RespMetadata.RequestID 443 } 444 445 // A warning returned by the document service when an issue is discovered while 446 // processing an upload request. 447 type DocumentServiceWarning struct { 448 _ struct{} `type:"structure"` 449 450 // The description for a warning returned by the document service. 451 Message *string `locationName:"message" type:"string"` 452 } 453 454 // String returns the string representation. 455 // 456 // API parameter values that are decorated as "sensitive" in the API will not 457 // be included in the string output. The member name will be present, but the 458 // value will be replaced with "sensitive". 459 func (s DocumentServiceWarning) String() string { 460 return awsutil.Prettify(s) 461 } 462 463 // GoString returns the string representation. 464 // 465 // API parameter values that are decorated as "sensitive" in the API will not 466 // be included in the string output. The member name will be present, but the 467 // value will be replaced with "sensitive". 468 func (s DocumentServiceWarning) GoString() string { 469 return s.String() 470 } 471 472 // SetMessage sets the Message field's value. 473 func (s *DocumentServiceWarning) SetMessage(v string) *DocumentServiceWarning { 474 s.Message = &v 475 return s 476 } 477 478 // The statistics for a field calculated in the request. 479 type FieldStats struct { 480 _ struct{} `type:"structure"` 481 482 // The number of documents that contain a value in the specified field in the 483 // result set. 484 Count *int64 `locationName:"count" type:"long"` 485 486 // The maximum value found in the specified field in the result set. 487 // 488 // If the field is numeric (int, int-array, double, or double-array), max is 489 // the string representation of a double-precision 64-bit floating point value. 490 // If the field is date or date-array, max is the string representation of a 491 // date with the format specified in IETF RFC3339 (http://tools.ietf.org/html/rfc3339): 492 // yyyy-mm-ddTHH:mm:ss.SSSZ. 493 Max *string `locationName:"max" type:"string"` 494 495 // The average of the values found in the specified field in the result set. 496 // 497 // If the field is numeric (int, int-array, double, or double-array), mean is 498 // the string representation of a double-precision 64-bit floating point value. 499 // If the field is date or date-array, mean is the string representation of 500 // a date with the format specified in IETF RFC3339 (http://tools.ietf.org/html/rfc3339): 501 // yyyy-mm-ddTHH:mm:ss.SSSZ. 502 Mean *string `locationName:"mean" type:"string"` 503 504 // The minimum value found in the specified field in the result set. 505 // 506 // If the field is numeric (int, int-array, double, or double-array), min is 507 // the string representation of a double-precision 64-bit floating point value. 508 // If the field is date or date-array, min is the string representation of a 509 // date with the format specified in IETF RFC3339 (http://tools.ietf.org/html/rfc3339): 510 // yyyy-mm-ddTHH:mm:ss.SSSZ. 511 Min *string `locationName:"min" type:"string"` 512 513 // The number of documents that do not contain a value in the specified field 514 // in the result set. 515 Missing *int64 `locationName:"missing" type:"long"` 516 517 // The standard deviation of the values in the specified field in the result 518 // set. 519 Stddev *float64 `locationName:"stddev" type:"double"` 520 521 // The sum of the field values across the documents in the result set. null 522 // for date fields. 523 Sum *float64 `locationName:"sum" type:"double"` 524 525 // The sum of all field values in the result set squared. 526 SumOfSquares *float64 `locationName:"sumOfSquares" type:"double"` 527 } 528 529 // String returns the string representation. 530 // 531 // API parameter values that are decorated as "sensitive" in the API will not 532 // be included in the string output. The member name will be present, but the 533 // value will be replaced with "sensitive". 534 func (s FieldStats) String() string { 535 return awsutil.Prettify(s) 536 } 537 538 // GoString returns the string representation. 539 // 540 // API parameter values that are decorated as "sensitive" in the API will not 541 // be included in the string output. The member name will be present, but the 542 // value will be replaced with "sensitive". 543 func (s FieldStats) GoString() string { 544 return s.String() 545 } 546 547 // SetCount sets the Count field's value. 548 func (s *FieldStats) SetCount(v int64) *FieldStats { 549 s.Count = &v 550 return s 551 } 552 553 // SetMax sets the Max field's value. 554 func (s *FieldStats) SetMax(v string) *FieldStats { 555 s.Max = &v 556 return s 557 } 558 559 // SetMean sets the Mean field's value. 560 func (s *FieldStats) SetMean(v string) *FieldStats { 561 s.Mean = &v 562 return s 563 } 564 565 // SetMin sets the Min field's value. 566 func (s *FieldStats) SetMin(v string) *FieldStats { 567 s.Min = &v 568 return s 569 } 570 571 // SetMissing sets the Missing field's value. 572 func (s *FieldStats) SetMissing(v int64) *FieldStats { 573 s.Missing = &v 574 return s 575 } 576 577 // SetStddev sets the Stddev field's value. 578 func (s *FieldStats) SetStddev(v float64) *FieldStats { 579 s.Stddev = &v 580 return s 581 } 582 583 // SetSum sets the Sum field's value. 584 func (s *FieldStats) SetSum(v float64) *FieldStats { 585 s.Sum = &v 586 return s 587 } 588 589 // SetSumOfSquares sets the SumOfSquares field's value. 590 func (s *FieldStats) SetSumOfSquares(v float64) *FieldStats { 591 s.SumOfSquares = &v 592 return s 593 } 594 595 // Information about a document that matches the search request. 596 type Hit struct { 597 _ struct{} `type:"structure"` 598 599 // The expressions returned from a document that matches the search request. 600 Exprs map[string]*string `locationName:"exprs" type:"map"` 601 602 // The fields returned from a document that matches the search request. 603 Fields map[string][]*string `locationName:"fields" type:"map"` 604 605 // The highlights returned from a document that matches the search request. 606 Highlights map[string]*string `locationName:"highlights" type:"map"` 607 608 // The document ID of a document that matches the search request. 609 Id *string `locationName:"id" type:"string"` 610 } 611 612 // String returns the string representation. 613 // 614 // API parameter values that are decorated as "sensitive" in the API will not 615 // be included in the string output. The member name will be present, but the 616 // value will be replaced with "sensitive". 617 func (s Hit) String() string { 618 return awsutil.Prettify(s) 619 } 620 621 // GoString returns the string representation. 622 // 623 // API parameter values that are decorated as "sensitive" in the API will not 624 // be included in the string output. The member name will be present, but the 625 // value will be replaced with "sensitive". 626 func (s Hit) GoString() string { 627 return s.String() 628 } 629 630 // SetExprs sets the Exprs field's value. 631 func (s *Hit) SetExprs(v map[string]*string) *Hit { 632 s.Exprs = v 633 return s 634 } 635 636 // SetFields sets the Fields field's value. 637 func (s *Hit) SetFields(v map[string][]*string) *Hit { 638 s.Fields = v 639 return s 640 } 641 642 // SetHighlights sets the Highlights field's value. 643 func (s *Hit) SetHighlights(v map[string]*string) *Hit { 644 s.Highlights = v 645 return s 646 } 647 648 // SetId sets the Id field's value. 649 func (s *Hit) SetId(v string) *Hit { 650 s.Id = &v 651 return s 652 } 653 654 // The collection of documents that match the search request. 655 type Hits struct { 656 _ struct{} `type:"structure"` 657 658 // A cursor that can be used to retrieve the next set of matching documents 659 // when you want to page through a large result set. 660 Cursor *string `locationName:"cursor" type:"string"` 661 662 // The total number of documents that match the search request. 663 Found *int64 `locationName:"found" type:"long"` 664 665 // A document that matches the search request. 666 Hit []*Hit `locationName:"hit" type:"list"` 667 668 // The index of the first matching document. 669 Start *int64 `locationName:"start" type:"long"` 670 } 671 672 // String returns the string representation. 673 // 674 // API parameter values that are decorated as "sensitive" in the API will not 675 // be included in the string output. The member name will be present, but the 676 // value will be replaced with "sensitive". 677 func (s Hits) String() string { 678 return awsutil.Prettify(s) 679 } 680 681 // GoString returns the string representation. 682 // 683 // API parameter values that are decorated as "sensitive" in the API will not 684 // be included in the string output. The member name will be present, but the 685 // value will be replaced with "sensitive". 686 func (s Hits) GoString() string { 687 return s.String() 688 } 689 690 // SetCursor sets the Cursor field's value. 691 func (s *Hits) SetCursor(v string) *Hits { 692 s.Cursor = &v 693 return s 694 } 695 696 // SetFound sets the Found field's value. 697 func (s *Hits) SetFound(v int64) *Hits { 698 s.Found = &v 699 return s 700 } 701 702 // SetHit sets the Hit field's value. 703 func (s *Hits) SetHit(v []*Hit) *Hits { 704 s.Hit = v 705 return s 706 } 707 708 // SetStart sets the Start field's value. 709 func (s *Hits) SetStart(v int64) *Hits { 710 s.Start = &v 711 return s 712 } 713 714 // Information about any problems encountered while processing a search request. 715 type SearchException struct { 716 _ struct{} `type:"structure"` 717 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 718 719 // A description of the error returned by the search service. 720 Message_ *string `locationName:"message" type:"string"` 721 } 722 723 // String returns the string representation. 724 // 725 // API parameter values that are decorated as "sensitive" in the API will not 726 // be included in the string output. The member name will be present, but the 727 // value will be replaced with "sensitive". 728 func (s SearchException) String() string { 729 return awsutil.Prettify(s) 730 } 731 732 // GoString returns the string representation. 733 // 734 // API parameter values that are decorated as "sensitive" in the API will not 735 // be included in the string output. The member name will be present, but the 736 // value will be replaced with "sensitive". 737 func (s SearchException) GoString() string { 738 return s.String() 739 } 740 741 func newErrorSearchException(v protocol.ResponseMetadata) error { 742 return &SearchException{ 743 RespMetadata: v, 744 } 745 } 746 747 // Code returns the exception type name. 748 func (s *SearchException) Code() string { 749 return "SearchException" 750 } 751 752 // Message returns the exception's message. 753 func (s *SearchException) Message() string { 754 if s.Message_ != nil { 755 return *s.Message_ 756 } 757 return "" 758 } 759 760 // OrigErr always returns nil, satisfies awserr.Error interface. 761 func (s *SearchException) OrigErr() error { 762 return nil 763 } 764 765 func (s *SearchException) Error() string { 766 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 767 } 768 769 // Status code returns the HTTP status code for the request's response error. 770 func (s *SearchException) StatusCode() int { 771 return s.RespMetadata.StatusCode 772 } 773 774 // RequestID returns the service's response RequestID for request. 775 func (s *SearchException) RequestID() string { 776 return s.RespMetadata.RequestID 777 } 778 779 // Container for the parameters to the Search request. 780 type SearchInput struct { 781 _ struct{} `type:"structure" nopayload:"true"` 782 783 // Retrieves a cursor value you can use to page through large result sets. Use 784 // the size parameter to control the number of hits to include in each response. 785 // You can specify either the cursor or start parameter in a request; they are 786 // mutually exclusive. To get the first cursor, set the cursor value to initial. 787 // In subsequent requests, specify the cursor value returned in the hits section 788 // of the response. 789 // 790 // For more information, see Paginating Results (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/paginating-results.html) 791 // in the Amazon CloudSearch Developer Guide. 792 Cursor *string `location:"querystring" locationName:"cursor" type:"string"` 793 794 // Defines one or more numeric expressions that can be used to sort results 795 // or specify search or filter criteria. You can also specify expressions as 796 // return fields. 797 // 798 // You specify the expressions in JSON using the form {"EXPRESSIONNAME":"EXPRESSION"}. 799 // You can define and use multiple expressions in a search request. For example: 800 // 801 // {"expression1":"_score*rating", "expression2":"(1/rank)*year"} 802 // 803 // For information about the variables, operators, and functions you can use 804 // in expressions, see Writing Expressions (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-expressions.html#writing-expressions) 805 // in the Amazon CloudSearch Developer Guide. 806 Expr *string `location:"querystring" locationName:"expr" type:"string"` 807 808 // Specifies one or more fields for which to get facet information, and options 809 // that control how the facet information is returned. Each specified field 810 // must be facet-enabled in the domain configuration. The fields and options 811 // are specified in JSON using the form {"FIELD":{"OPTION":VALUE,"OPTION:"STRING"},"FIELD":{"OPTION":VALUE,"OPTION":"STRING"}}. 812 // 813 // You can specify the following faceting options: 814 // 815 // * buckets specifies an array of the facet values or ranges to count. Ranges 816 // are specified using the same syntax that you use to search for a range 817 // of values. For more information, see Searching for a Range of Values (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-ranges.html) 818 // in the Amazon CloudSearch Developer Guide. Buckets are returned in the 819 // order they are specified in the request. The sort and size options are 820 // not valid if you specify buckets. 821 // 822 // * size specifies the maximum number of facets to include in the results. 823 // By default, Amazon CloudSearch returns counts for the top 10. The size 824 // parameter is only valid when you specify the sort option; it cannot be 825 // used in conjunction with buckets. 826 // 827 // * sort specifies how you want to sort the facets in the results: bucket 828 // or count. Specify bucket to sort alphabetically or numerically by facet 829 // value (in ascending order). Specify count to sort by the facet counts 830 // computed for each facet value (in descending order). To retrieve facet 831 // counts for particular values or ranges of values, use the buckets option 832 // instead of sort. 833 // 834 // If no facet options are specified, facet counts are computed for all field 835 // values, the facets are sorted by facet count, and the top 10 facets are returned 836 // in the results. 837 // 838 // To count particular buckets of values, use the buckets option. For example, 839 // the following request uses the buckets option to calculate and return facet 840 // counts by decade. 841 // 842 // {"year":{"buckets":["[1970,1979]","[1980,1989]","[1990,1999]","[2000,2009]","[2010,}"]}} 843 // 844 // To sort facets by facet count, use the count option. For example, the following 845 // request sets the sort option to count to sort the facet values by facet count, 846 // with the facet values that have the most matching documents listed first. 847 // Setting the size option to 3 returns only the top three facet values. 848 // 849 // {"year":{"sort":"count","size":3}} 850 // 851 // To sort the facets by value, use the bucket option. For example, the following 852 // request sets the sort option to bucket to sort the facet values numerically 853 // by year, with earliest year listed first. 854 // 855 // {"year":{"sort":"bucket"}} 856 // 857 // For more information, see Getting and Using Facet Information (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/faceting.html) 858 // in the Amazon CloudSearch Developer Guide. 859 Facet *string `location:"querystring" locationName:"facet" type:"string"` 860 861 // Specifies a structured query that filters the results of a search without 862 // affecting how the results are scored and sorted. You use filterQuery in conjunction 863 // with the query parameter to filter the documents that match the constraints 864 // specified in the query parameter. Specifying a filter controls only which 865 // matching documents are included in the results, it has no effect on how they 866 // are scored and sorted. The filterQuery parameter supports the full structured 867 // query syntax. 868 // 869 // For more information about using filters, see Filtering Matching Documents 870 // (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/filtering-results.html) 871 // in the Amazon CloudSearch Developer Guide. 872 FilterQuery *string `location:"querystring" locationName:"fq" type:"string"` 873 874 // Retrieves highlights for matches in the specified text or text-array fields. 875 // Each specified field must be highlight enabled in the domain configuration. 876 // The fields and options are specified in JSON using the form {"FIELD":{"OPTION":VALUE,"OPTION:"STRING"},"FIELD":{"OPTION":VALUE,"OPTION":"STRING"}}. 877 // 878 // You can specify the following highlight options: 879 // 880 // * format: specifies the format of the data in the text field: text or 881 // html. When data is returned as HTML, all non-alphanumeric characters are 882 // encoded. The default is html. 883 // 884 // * max_phrases: specifies the maximum number of occurrences of the search 885 // term(s) you want to highlight. By default, the first occurrence is highlighted. 886 // 887 // * pre_tag: specifies the string to prepend to an occurrence of a search 888 // term. The default for HTML highlights is <em>. The default for text 889 // highlights is *. 890 // 891 // * post_tag: specifies the string to append to an occurrence of a search 892 // term. The default for HTML highlights is </em>. The default for 893 // text highlights is *. 894 // 895 // If no highlight options are specified for a field, the returned field text 896 // is treated as HTML and the first match is highlighted with emphasis tags: 897 // <em>search-term</em>. 898 // 899 // For example, the following request retrieves highlights for the actors and 900 // title fields. 901 // 902 // { "actors": {}, "title": {"format": "text","max_phrases": 2,"pre_tag": "","post_tag": 903 // ""} } 904 Highlight *string `location:"querystring" locationName:"highlight" type:"string"` 905 906 // Enables partial results to be returned if one or more index partitions are 907 // unavailable. When your search index is partitioned across multiple search 908 // instances, by default Amazon CloudSearch only returns results if every partition 909 // can be queried. This means that the failure of a single search instance can 910 // result in 5xx (internal server) errors. When you enable partial results, 911 // Amazon CloudSearch returns whatever results are available and includes the 912 // percentage of documents searched in the search results (percent-searched). 913 // This enables you to more gracefully degrade your users' search experience. 914 // For example, rather than displaying no results, you could display the partial 915 // results and a message indicating that the results might be incomplete due 916 // to a temporary system outage. 917 Partial *bool `location:"querystring" locationName:"partial" type:"boolean"` 918 919 // Specifies the search criteria for the request. How you specify the search 920 // criteria depends on the query parser used for the request and the parser 921 // options specified in the queryOptions parameter. By default, the simple query 922 // parser is used to process requests. To use the structured, lucene, or dismax 923 // query parser, you must also specify the queryParser parameter. 924 // 925 // For more information about specifying search criteria, see Searching Your 926 // Data (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching.html) 927 // in the Amazon CloudSearch Developer Guide. 928 // 929 // Query is a required field 930 Query *string `location:"querystring" locationName:"q" type:"string" required:"true"` 931 932 // Configures options for the query parser specified in the queryParser parameter. 933 // You specify the options in JSON using the following form {"OPTION1":"VALUE1","OPTION2":VALUE2"..."OPTIONN":"VALUEN"}. 934 // 935 // The options you can configure vary according to which parser you use: 936 // 937 // * defaultOperator: The default operator used to combine individual terms 938 // in the search string. For example: defaultOperator: 'or'. For the dismax 939 // parser, you specify a percentage that represents the percentage of terms 940 // in the search string (rounded down) that must match, rather than a default 941 // operator. A value of 0% is the equivalent to OR, and a value of 100% is 942 // equivalent to AND. The percentage must be specified as a value in the 943 // range 0-100 followed by the percent (%) symbol. For example, defaultOperator: 944 // 50%. Valid values: and, or, a percentage in the range 0%-100% (dismax). 945 // Default: and (simple, structured, lucene) or 100 (dismax). Valid for: 946 // simple, structured, lucene, and dismax. 947 // 948 // * fields: An array of the fields to search when no fields are specified 949 // in a search. If no fields are specified in a search and this option is 950 // not specified, all text and text-array fields are searched. You can specify 951 // a weight for each field to control the relative importance of each field 952 // when Amazon CloudSearch calculates relevance scores. To specify a field 953 // weight, append a caret (^) symbol and the weight to the field name. For 954 // example, to boost the importance of the title field over the description 955 // field you could specify: "fields":["title^5","description"]. Valid values: 956 // The name of any configured field and an optional numeric value greater 957 // than zero. Default: All text and text-array fields. Valid for: simple, 958 // structured, lucene, and dismax. 959 // 960 // * operators: An array of the operators or special characters you want 961 // to disable for the simple query parser. If you disable the and, or, or 962 // not operators, the corresponding operators (+, |, -) have no special meaning 963 // and are dropped from the search string. Similarly, disabling prefix disables 964 // the wildcard operator (*) and disabling phrase disables the ability to 965 // search for phrases by enclosing phrases in double quotes. Disabling precedence 966 // disables the ability to control order of precedence using parentheses. 967 // Disabling near disables the ability to use the ~ operator to perform a 968 // sloppy phrase search. Disabling the fuzzy operator disables the ability 969 // to use the ~ operator to perform a fuzzy search. escape disables the ability 970 // to use a backslash (\) to escape special characters within the search 971 // string. Disabling whitespace is an advanced option that prevents the parser 972 // from tokenizing on whitespace, which can be useful for Vietnamese. (It 973 // prevents Vietnamese words from being split incorrectly.) For example, 974 // you could disable all operators other than the phrase operator to support 975 // just simple term and phrase queries: "operators":["and","not","or", "prefix"]. 976 // Valid values: and, escape, fuzzy, near, not, or, phrase, precedence, prefix, 977 // whitespace. Default: All operators and special characters are enabled. 978 // Valid for: simple. 979 // 980 // * phraseFields: An array of the text or text-array fields you want to 981 // use for phrase searches. When the terms in the search string appear in 982 // close proximity within a field, the field scores higher. You can specify 983 // a weight for each field to boost that score. The phraseSlop option controls 984 // how much the matches can deviate from the search string and still be boosted. 985 // To specify a field weight, append a caret (^) symbol and the weight to 986 // the field name. For example, to boost phrase matches in the title field 987 // over the abstract field, you could specify: "phraseFields":["title^3", 988 // "plot"] Valid values: The name of any text or text-array field and an 989 // optional numeric value greater than zero. Default: No fields. If you don't 990 // specify any fields with phraseFields, proximity scoring is disabled even 991 // if phraseSlop is specified. Valid for: dismax. 992 // 993 // * phraseSlop: An integer value that specifies how much matches can deviate 994 // from the search phrase and still be boosted according to the weights specified 995 // in the phraseFields option; for example, phraseSlop: 2. You must also 996 // specify phraseFields to enable proximity scoring. Valid values: positive 997 // integers. Default: 0. Valid for: dismax. 998 // 999 // * explicitPhraseSlop: An integer value that specifies how much a match 1000 // can deviate from the search phrase when the phrase is enclosed in double 1001 // quotes in the search string. (Phrases that exceed this proximity distance 1002 // are not considered a match.) For example, to specify a slop of three for 1003 // dismax phrase queries, you would specify "explicitPhraseSlop":3. Valid 1004 // values: positive integers. Default: 0. Valid for: dismax. 1005 // 1006 // * tieBreaker: When a term in the search string is found in a document's 1007 // field, a score is calculated for that field based on how common the word 1008 // is in that field compared to other documents. If the term occurs in multiple 1009 // fields within a document, by default only the highest scoring field contributes 1010 // to the document's overall score. You can specify a tieBreaker value to 1011 // enable the matches in lower-scoring fields to contribute to the document's 1012 // score. That way, if two documents have the same max field score for a 1013 // particular term, the score for the document that has matches in more fields 1014 // will be higher. The formula for calculating the score with a tieBreaker 1015 // is (max field score) + (tieBreaker) * (sum of the scores for the rest 1016 // of the matching fields). Set tieBreaker to 0 to disregard all but the 1017 // highest scoring field (pure max): "tieBreaker":0. Set to 1 to sum the 1018 // scores from all fields (pure sum): "tieBreaker":1. Valid values: 0.0 to 1019 // 1.0. Default: 0.0. Valid for: dismax. 1020 QueryOptions *string `location:"querystring" locationName:"q.options" type:"string"` 1021 1022 // Specifies which query parser to use to process the request. If queryParser 1023 // is not specified, Amazon CloudSearch uses the simple query parser. 1024 // 1025 // Amazon CloudSearch supports four query parsers: 1026 // 1027 // * simple: perform simple searches of text and text-array fields. By default, 1028 // the simple query parser searches all text and text-array fields. You can 1029 // specify which fields to search by with the queryOptions parameter. If 1030 // you prefix a search term with a plus sign (+) documents must contain the 1031 // term to be considered a match. (This is the default, unless you configure 1032 // the default operator with the queryOptions parameter.) You can use the 1033 // - (NOT), | (OR), and * (wildcard) operators to exclude particular terms, 1034 // find results that match any of the specified terms, or search for a prefix. 1035 // To search for a phrase rather than individual terms, enclose the phrase 1036 // in double quotes. For more information, see Searching for Text in the 1037 // Amazon CloudSearch Developer Guide. 1038 // 1039 // * structured: perform advanced searches by combining multiple expressions 1040 // to define the search criteria. You can also search within particular fields, 1041 // search for values and ranges of values, and use advanced options such 1042 // as term boosting, matchall, and near. For more information, see Constructing 1043 // Compound Queries in the Amazon CloudSearch Developer Guide. 1044 // 1045 // * lucene: search using the Apache Lucene query parser syntax. For more 1046 // information, see Apache Lucene Query Parser Syntax. 1047 // 1048 // * dismax: search using the simplified subset of the Apache Lucene query 1049 // parser syntax defined by the DisMax query parser. For more information, 1050 // see DisMax Query Parser Syntax. 1051 QueryParser *string `location:"querystring" locationName:"q.parser" type:"string" enum:"QueryParser"` 1052 1053 // Specifies the field and expression values to include in the response. Multiple 1054 // fields or expressions are specified as a comma-separated list. By default, 1055 // a search response includes all return enabled fields (_all_fields). To return 1056 // only the document IDs for the matching documents, specify _no_fields. To 1057 // retrieve the relevance score calculated for each document, specify _score. 1058 Return *string `location:"querystring" locationName:"return" type:"string"` 1059 1060 // Specifies the maximum number of search hits to include in the response. 1061 Size *int64 `location:"querystring" locationName:"size" type:"long"` 1062 1063 // Specifies the fields or custom expressions to use to sort the search results. 1064 // Multiple fields or expressions are specified as a comma-separated list. You 1065 // must specify the sort direction (asc or desc) for each field; for example, 1066 // year desc,title asc. To use a field to sort results, the field must be sort-enabled 1067 // in the domain configuration. Array type fields cannot be used for sorting. 1068 // If no sort parameter is specified, results are sorted by their default relevance 1069 // scores in descending order: _score desc. You can also sort by document ID 1070 // (_id asc) and version (_version desc). 1071 // 1072 // For more information, see Sorting Results (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/sorting-results.html) 1073 // in the Amazon CloudSearch Developer Guide. 1074 Sort *string `location:"querystring" locationName:"sort" type:"string"` 1075 1076 // Specifies the offset of the first search hit you want to return. Note that 1077 // the result set is zero-based; the first result is at index 0. You can specify 1078 // either the start or cursor parameter in a request, they are mutually exclusive. 1079 // 1080 // For more information, see Paginating Results (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/paginating-results.html) 1081 // in the Amazon CloudSearch Developer Guide. 1082 Start *int64 `location:"querystring" locationName:"start" type:"long"` 1083 1084 // Specifies one or more fields for which to get statistics information. Each 1085 // specified field must be facet-enabled in the domain configuration. The fields 1086 // are specified in JSON using the form: 1087 // 1088 // {"FIELD-A":{},"FIELD-B":{}} 1089 // 1090 // There are currently no options supported for statistics. 1091 Stats *string `location:"querystring" locationName:"stats" type:"string"` 1092 } 1093 1094 // String returns the string representation. 1095 // 1096 // API parameter values that are decorated as "sensitive" in the API will not 1097 // be included in the string output. The member name will be present, but the 1098 // value will be replaced with "sensitive". 1099 func (s SearchInput) String() string { 1100 return awsutil.Prettify(s) 1101 } 1102 1103 // GoString returns the string representation. 1104 // 1105 // API parameter values that are decorated as "sensitive" in the API will not 1106 // be included in the string output. The member name will be present, but the 1107 // value will be replaced with "sensitive". 1108 func (s SearchInput) GoString() string { 1109 return s.String() 1110 } 1111 1112 // Validate inspects the fields of the type to determine if they are valid. 1113 func (s *SearchInput) Validate() error { 1114 invalidParams := request.ErrInvalidParams{Context: "SearchInput"} 1115 if s.Query == nil { 1116 invalidParams.Add(request.NewErrParamRequired("Query")) 1117 } 1118 1119 if invalidParams.Len() > 0 { 1120 return invalidParams 1121 } 1122 return nil 1123 } 1124 1125 // SetCursor sets the Cursor field's value. 1126 func (s *SearchInput) SetCursor(v string) *SearchInput { 1127 s.Cursor = &v 1128 return s 1129 } 1130 1131 // SetExpr sets the Expr field's value. 1132 func (s *SearchInput) SetExpr(v string) *SearchInput { 1133 s.Expr = &v 1134 return s 1135 } 1136 1137 // SetFacet sets the Facet field's value. 1138 func (s *SearchInput) SetFacet(v string) *SearchInput { 1139 s.Facet = &v 1140 return s 1141 } 1142 1143 // SetFilterQuery sets the FilterQuery field's value. 1144 func (s *SearchInput) SetFilterQuery(v string) *SearchInput { 1145 s.FilterQuery = &v 1146 return s 1147 } 1148 1149 // SetHighlight sets the Highlight field's value. 1150 func (s *SearchInput) SetHighlight(v string) *SearchInput { 1151 s.Highlight = &v 1152 return s 1153 } 1154 1155 // SetPartial sets the Partial field's value. 1156 func (s *SearchInput) SetPartial(v bool) *SearchInput { 1157 s.Partial = &v 1158 return s 1159 } 1160 1161 // SetQuery sets the Query field's value. 1162 func (s *SearchInput) SetQuery(v string) *SearchInput { 1163 s.Query = &v 1164 return s 1165 } 1166 1167 // SetQueryOptions sets the QueryOptions field's value. 1168 func (s *SearchInput) SetQueryOptions(v string) *SearchInput { 1169 s.QueryOptions = &v 1170 return s 1171 } 1172 1173 // SetQueryParser sets the QueryParser field's value. 1174 func (s *SearchInput) SetQueryParser(v string) *SearchInput { 1175 s.QueryParser = &v 1176 return s 1177 } 1178 1179 // SetReturn sets the Return field's value. 1180 func (s *SearchInput) SetReturn(v string) *SearchInput { 1181 s.Return = &v 1182 return s 1183 } 1184 1185 // SetSize sets the Size field's value. 1186 func (s *SearchInput) SetSize(v int64) *SearchInput { 1187 s.Size = &v 1188 return s 1189 } 1190 1191 // SetSort sets the Sort field's value. 1192 func (s *SearchInput) SetSort(v string) *SearchInput { 1193 s.Sort = &v 1194 return s 1195 } 1196 1197 // SetStart sets the Start field's value. 1198 func (s *SearchInput) SetStart(v int64) *SearchInput { 1199 s.Start = &v 1200 return s 1201 } 1202 1203 // SetStats sets the Stats field's value. 1204 func (s *SearchInput) SetStats(v string) *SearchInput { 1205 s.Stats = &v 1206 return s 1207 } 1208 1209 // The result of a Search request. Contains the documents that match the specified 1210 // search criteria and any requested fields, highlights, and facet information. 1211 type SearchOutput struct { 1212 _ struct{} `type:"structure"` 1213 1214 // The requested facet information. 1215 Facets map[string]*BucketInfo `locationName:"facets" type:"map"` 1216 1217 // The documents that match the search criteria. 1218 Hits *Hits `locationName:"hits" type:"structure"` 1219 1220 // The requested field statistics information. 1221 Stats map[string]*FieldStats `locationName:"stats" type:"map"` 1222 1223 // The status information returned for the search request. 1224 Status *SearchStatus `locationName:"status" type:"structure"` 1225 } 1226 1227 // String returns the string representation. 1228 // 1229 // API parameter values that are decorated as "sensitive" in the API will not 1230 // be included in the string output. The member name will be present, but the 1231 // value will be replaced with "sensitive". 1232 func (s SearchOutput) String() string { 1233 return awsutil.Prettify(s) 1234 } 1235 1236 // GoString returns the string representation. 1237 // 1238 // API parameter values that are decorated as "sensitive" in the API will not 1239 // be included in the string output. The member name will be present, but the 1240 // value will be replaced with "sensitive". 1241 func (s SearchOutput) GoString() string { 1242 return s.String() 1243 } 1244 1245 // SetFacets sets the Facets field's value. 1246 func (s *SearchOutput) SetFacets(v map[string]*BucketInfo) *SearchOutput { 1247 s.Facets = v 1248 return s 1249 } 1250 1251 // SetHits sets the Hits field's value. 1252 func (s *SearchOutput) SetHits(v *Hits) *SearchOutput { 1253 s.Hits = v 1254 return s 1255 } 1256 1257 // SetStats sets the Stats field's value. 1258 func (s *SearchOutput) SetStats(v map[string]*FieldStats) *SearchOutput { 1259 s.Stats = v 1260 return s 1261 } 1262 1263 // SetStatus sets the Status field's value. 1264 func (s *SearchOutput) SetStatus(v *SearchStatus) *SearchOutput { 1265 s.Status = v 1266 return s 1267 } 1268 1269 // Contains the resource id (rid) and the time it took to process the request 1270 // (timems). 1271 type SearchStatus struct { 1272 _ struct{} `type:"structure"` 1273 1274 // The encrypted resource ID for the request. 1275 Rid *string `locationName:"rid" type:"string"` 1276 1277 // How long it took to process the request, in milliseconds. 1278 Timems *int64 `locationName:"timems" type:"long"` 1279 } 1280 1281 // String returns the string representation. 1282 // 1283 // API parameter values that are decorated as "sensitive" in the API will not 1284 // be included in the string output. The member name will be present, but the 1285 // value will be replaced with "sensitive". 1286 func (s SearchStatus) String() string { 1287 return awsutil.Prettify(s) 1288 } 1289 1290 // GoString returns the string representation. 1291 // 1292 // API parameter values that are decorated as "sensitive" in the API will not 1293 // be included in the string output. The member name will be present, but the 1294 // value will be replaced with "sensitive". 1295 func (s SearchStatus) GoString() string { 1296 return s.String() 1297 } 1298 1299 // SetRid sets the Rid field's value. 1300 func (s *SearchStatus) SetRid(v string) *SearchStatus { 1301 s.Rid = &v 1302 return s 1303 } 1304 1305 // SetTimems sets the Timems field's value. 1306 func (s *SearchStatus) SetTimems(v int64) *SearchStatus { 1307 s.Timems = &v 1308 return s 1309 } 1310 1311 // Container for the parameters to the Suggest request. 1312 type SuggestInput struct { 1313 _ struct{} `type:"structure" nopayload:"true"` 1314 1315 // Specifies the string for which you want to get suggestions. 1316 // 1317 // Query is a required field 1318 Query *string `location:"querystring" locationName:"q" type:"string" required:"true"` 1319 1320 // Specifies the maximum number of suggestions to return. 1321 Size *int64 `location:"querystring" locationName:"size" type:"long"` 1322 1323 // Specifies the name of the suggester to use to find suggested matches. 1324 // 1325 // Suggester is a required field 1326 Suggester *string `location:"querystring" locationName:"suggester" type:"string" required:"true"` 1327 } 1328 1329 // String returns the string representation. 1330 // 1331 // API parameter values that are decorated as "sensitive" in the API will not 1332 // be included in the string output. The member name will be present, but the 1333 // value will be replaced with "sensitive". 1334 func (s SuggestInput) String() string { 1335 return awsutil.Prettify(s) 1336 } 1337 1338 // GoString returns the string representation. 1339 // 1340 // API parameter values that are decorated as "sensitive" in the API will not 1341 // be included in the string output. The member name will be present, but the 1342 // value will be replaced with "sensitive". 1343 func (s SuggestInput) GoString() string { 1344 return s.String() 1345 } 1346 1347 // Validate inspects the fields of the type to determine if they are valid. 1348 func (s *SuggestInput) Validate() error { 1349 invalidParams := request.ErrInvalidParams{Context: "SuggestInput"} 1350 if s.Query == nil { 1351 invalidParams.Add(request.NewErrParamRequired("Query")) 1352 } 1353 if s.Suggester == nil { 1354 invalidParams.Add(request.NewErrParamRequired("Suggester")) 1355 } 1356 1357 if invalidParams.Len() > 0 { 1358 return invalidParams 1359 } 1360 return nil 1361 } 1362 1363 // SetQuery sets the Query field's value. 1364 func (s *SuggestInput) SetQuery(v string) *SuggestInput { 1365 s.Query = &v 1366 return s 1367 } 1368 1369 // SetSize sets the Size field's value. 1370 func (s *SuggestInput) SetSize(v int64) *SuggestInput { 1371 s.Size = &v 1372 return s 1373 } 1374 1375 // SetSuggester sets the Suggester field's value. 1376 func (s *SuggestInput) SetSuggester(v string) *SuggestInput { 1377 s.Suggester = &v 1378 return s 1379 } 1380 1381 // Container for the suggestion information returned in a SuggestResponse. 1382 type SuggestModel struct { 1383 _ struct{} `type:"structure"` 1384 1385 // The number of documents that were found to match the query string. 1386 Found *int64 `locationName:"found" type:"long"` 1387 1388 // The query string specified in the suggest request. 1389 Query *string `locationName:"query" type:"string"` 1390 1391 // The documents that match the query string. 1392 Suggestions []*SuggestionMatch `locationName:"suggestions" type:"list"` 1393 } 1394 1395 // String returns the string representation. 1396 // 1397 // API parameter values that are decorated as "sensitive" in the API will not 1398 // be included in the string output. The member name will be present, but the 1399 // value will be replaced with "sensitive". 1400 func (s SuggestModel) String() string { 1401 return awsutil.Prettify(s) 1402 } 1403 1404 // GoString returns the string representation. 1405 // 1406 // API parameter values that are decorated as "sensitive" in the API will not 1407 // be included in the string output. The member name will be present, but the 1408 // value will be replaced with "sensitive". 1409 func (s SuggestModel) GoString() string { 1410 return s.String() 1411 } 1412 1413 // SetFound sets the Found field's value. 1414 func (s *SuggestModel) SetFound(v int64) *SuggestModel { 1415 s.Found = &v 1416 return s 1417 } 1418 1419 // SetQuery sets the Query field's value. 1420 func (s *SuggestModel) SetQuery(v string) *SuggestModel { 1421 s.Query = &v 1422 return s 1423 } 1424 1425 // SetSuggestions sets the Suggestions field's value. 1426 func (s *SuggestModel) SetSuggestions(v []*SuggestionMatch) *SuggestModel { 1427 s.Suggestions = v 1428 return s 1429 } 1430 1431 // Contains the response to a Suggest request. 1432 type SuggestOutput struct { 1433 _ struct{} `type:"structure"` 1434 1435 // The status of a SuggestRequest. Contains the resource ID (rid) and how long 1436 // it took to process the request (timems). 1437 Status *SuggestStatus `locationName:"status" type:"structure"` 1438 1439 // Container for the matching search suggestion information. 1440 Suggest *SuggestModel `locationName:"suggest" type:"structure"` 1441 } 1442 1443 // String returns the string representation. 1444 // 1445 // API parameter values that are decorated as "sensitive" in the API will not 1446 // be included in the string output. The member name will be present, but the 1447 // value will be replaced with "sensitive". 1448 func (s SuggestOutput) String() string { 1449 return awsutil.Prettify(s) 1450 } 1451 1452 // GoString returns the string representation. 1453 // 1454 // API parameter values that are decorated as "sensitive" in the API will not 1455 // be included in the string output. The member name will be present, but the 1456 // value will be replaced with "sensitive". 1457 func (s SuggestOutput) GoString() string { 1458 return s.String() 1459 } 1460 1461 // SetStatus sets the Status field's value. 1462 func (s *SuggestOutput) SetStatus(v *SuggestStatus) *SuggestOutput { 1463 s.Status = v 1464 return s 1465 } 1466 1467 // SetSuggest sets the Suggest field's value. 1468 func (s *SuggestOutput) SetSuggest(v *SuggestModel) *SuggestOutput { 1469 s.Suggest = v 1470 return s 1471 } 1472 1473 // Contains the resource id (rid) and the time it took to process the request 1474 // (timems). 1475 type SuggestStatus struct { 1476 _ struct{} `type:"structure"` 1477 1478 // The encrypted resource ID for the request. 1479 Rid *string `locationName:"rid" type:"string"` 1480 1481 // How long it took to process the request, in milliseconds. 1482 Timems *int64 `locationName:"timems" type:"long"` 1483 } 1484 1485 // String returns the string representation. 1486 // 1487 // API parameter values that are decorated as "sensitive" in the API will not 1488 // be included in the string output. The member name will be present, but the 1489 // value will be replaced with "sensitive". 1490 func (s SuggestStatus) String() string { 1491 return awsutil.Prettify(s) 1492 } 1493 1494 // GoString returns the string representation. 1495 // 1496 // API parameter values that are decorated as "sensitive" in the API will not 1497 // be included in the string output. The member name will be present, but the 1498 // value will be replaced with "sensitive". 1499 func (s SuggestStatus) GoString() string { 1500 return s.String() 1501 } 1502 1503 // SetRid sets the Rid field's value. 1504 func (s *SuggestStatus) SetRid(v string) *SuggestStatus { 1505 s.Rid = &v 1506 return s 1507 } 1508 1509 // SetTimems sets the Timems field's value. 1510 func (s *SuggestStatus) SetTimems(v int64) *SuggestStatus { 1511 s.Timems = &v 1512 return s 1513 } 1514 1515 // An autocomplete suggestion that matches the query string specified in a SuggestRequest. 1516 type SuggestionMatch struct { 1517 _ struct{} `type:"structure"` 1518 1519 // The document ID of the suggested document. 1520 Id *string `locationName:"id" type:"string"` 1521 1522 // The relevance score of a suggested match. 1523 Score *int64 `locationName:"score" type:"long"` 1524 1525 // The string that matches the query string specified in the SuggestRequest. 1526 Suggestion *string `locationName:"suggestion" type:"string"` 1527 } 1528 1529 // String returns the string representation. 1530 // 1531 // API parameter values that are decorated as "sensitive" in the API will not 1532 // be included in the string output. The member name will be present, but the 1533 // value will be replaced with "sensitive". 1534 func (s SuggestionMatch) String() string { 1535 return awsutil.Prettify(s) 1536 } 1537 1538 // GoString returns the string representation. 1539 // 1540 // API parameter values that are decorated as "sensitive" in the API will not 1541 // be included in the string output. The member name will be present, but the 1542 // value will be replaced with "sensitive". 1543 func (s SuggestionMatch) GoString() string { 1544 return s.String() 1545 } 1546 1547 // SetId sets the Id field's value. 1548 func (s *SuggestionMatch) SetId(v string) *SuggestionMatch { 1549 s.Id = &v 1550 return s 1551 } 1552 1553 // SetScore sets the Score field's value. 1554 func (s *SuggestionMatch) SetScore(v int64) *SuggestionMatch { 1555 s.Score = &v 1556 return s 1557 } 1558 1559 // SetSuggestion sets the Suggestion field's value. 1560 func (s *SuggestionMatch) SetSuggestion(v string) *SuggestionMatch { 1561 s.Suggestion = &v 1562 return s 1563 } 1564 1565 // Container for the parameters to the UploadDocuments request. 1566 type UploadDocumentsInput struct { 1567 _ struct{} `type:"structure" payload:"Documents"` 1568 1569 // The format of the batch you are uploading. Amazon CloudSearch supports two 1570 // document batch formats: 1571 // 1572 // * application/json 1573 // 1574 // * application/xml 1575 // 1576 // ContentType is a required field 1577 ContentType *string `location:"header" locationName:"Content-Type" type:"string" required:"true" enum:"ContentType"` 1578 1579 // A batch of documents formatted in JSON or HTML. 1580 // 1581 // Documents is a required field 1582 Documents io.ReadSeeker `locationName:"documents" type:"blob" required:"true"` 1583 } 1584 1585 // String returns the string representation. 1586 // 1587 // API parameter values that are decorated as "sensitive" in the API will not 1588 // be included in the string output. The member name will be present, but the 1589 // value will be replaced with "sensitive". 1590 func (s UploadDocumentsInput) String() string { 1591 return awsutil.Prettify(s) 1592 } 1593 1594 // GoString returns the string representation. 1595 // 1596 // API parameter values that are decorated as "sensitive" in the API will not 1597 // be included in the string output. The member name will be present, but the 1598 // value will be replaced with "sensitive". 1599 func (s UploadDocumentsInput) GoString() string { 1600 return s.String() 1601 } 1602 1603 // Validate inspects the fields of the type to determine if they are valid. 1604 func (s *UploadDocumentsInput) Validate() error { 1605 invalidParams := request.ErrInvalidParams{Context: "UploadDocumentsInput"} 1606 if s.ContentType == nil { 1607 invalidParams.Add(request.NewErrParamRequired("ContentType")) 1608 } 1609 if s.Documents == nil { 1610 invalidParams.Add(request.NewErrParamRequired("Documents")) 1611 } 1612 1613 if invalidParams.Len() > 0 { 1614 return invalidParams 1615 } 1616 return nil 1617 } 1618 1619 // SetContentType sets the ContentType field's value. 1620 func (s *UploadDocumentsInput) SetContentType(v string) *UploadDocumentsInput { 1621 s.ContentType = &v 1622 return s 1623 } 1624 1625 // SetDocuments sets the Documents field's value. 1626 func (s *UploadDocumentsInput) SetDocuments(v io.ReadSeeker) *UploadDocumentsInput { 1627 s.Documents = v 1628 return s 1629 } 1630 1631 // Contains the response to an UploadDocuments request. 1632 type UploadDocumentsOutput struct { 1633 _ struct{} `type:"structure"` 1634 1635 // The number of documents that were added to the search domain. 1636 Adds *int64 `locationName:"adds" type:"long"` 1637 1638 // The number of documents that were deleted from the search domain. 1639 Deletes *int64 `locationName:"deletes" type:"long"` 1640 1641 // The status of an UploadDocumentsRequest. 1642 Status *string `locationName:"status" type:"string"` 1643 1644 // Any warnings returned by the document service about the documents being uploaded. 1645 Warnings []*DocumentServiceWarning `locationName:"warnings" type:"list"` 1646 } 1647 1648 // String returns the string representation. 1649 // 1650 // API parameter values that are decorated as "sensitive" in the API will not 1651 // be included in the string output. The member name will be present, but the 1652 // value will be replaced with "sensitive". 1653 func (s UploadDocumentsOutput) String() string { 1654 return awsutil.Prettify(s) 1655 } 1656 1657 // GoString returns the string representation. 1658 // 1659 // API parameter values that are decorated as "sensitive" in the API will not 1660 // be included in the string output. The member name will be present, but the 1661 // value will be replaced with "sensitive". 1662 func (s UploadDocumentsOutput) GoString() string { 1663 return s.String() 1664 } 1665 1666 // SetAdds sets the Adds field's value. 1667 func (s *UploadDocumentsOutput) SetAdds(v int64) *UploadDocumentsOutput { 1668 s.Adds = &v 1669 return s 1670 } 1671 1672 // SetDeletes sets the Deletes field's value. 1673 func (s *UploadDocumentsOutput) SetDeletes(v int64) *UploadDocumentsOutput { 1674 s.Deletes = &v 1675 return s 1676 } 1677 1678 // SetStatus sets the Status field's value. 1679 func (s *UploadDocumentsOutput) SetStatus(v string) *UploadDocumentsOutput { 1680 s.Status = &v 1681 return s 1682 } 1683 1684 // SetWarnings sets the Warnings field's value. 1685 func (s *UploadDocumentsOutput) SetWarnings(v []*DocumentServiceWarning) *UploadDocumentsOutput { 1686 s.Warnings = v 1687 return s 1688 } 1689 1690 const ( 1691 // ContentTypeApplicationJson is a ContentType enum value 1692 ContentTypeApplicationJson = "application/json" 1693 1694 // ContentTypeApplicationXml is a ContentType enum value 1695 ContentTypeApplicationXml = "application/xml" 1696 ) 1697 1698 // ContentType_Values returns all elements of the ContentType enum 1699 func ContentType_Values() []string { 1700 return []string{ 1701 ContentTypeApplicationJson, 1702 ContentTypeApplicationXml, 1703 } 1704 } 1705 1706 const ( 1707 // QueryParserSimple is a QueryParser enum value 1708 QueryParserSimple = "simple" 1709 1710 // QueryParserStructured is a QueryParser enum value 1711 QueryParserStructured = "structured" 1712 1713 // QueryParserLucene is a QueryParser enum value 1714 QueryParserLucene = "lucene" 1715 1716 // QueryParserDismax is a QueryParser enum value 1717 QueryParserDismax = "dismax" 1718 ) 1719 1720 // QueryParser_Values returns all elements of the QueryParser enum 1721 func QueryParser_Values() []string { 1722 return []string{ 1723 QueryParserSimple, 1724 QueryParserStructured, 1725 QueryParserLucene, 1726 QueryParserDismax, 1727 } 1728 }