api.go 53 KB

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