api.go 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package cloudsearchdomain provides a client for Amazon CloudSearch Domain.
  3. package cloudsearchdomain
  4. import (
  5. "io"
  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 can be used to capture response data after the request's "Send" method
  13. // is called.
  14. //
  15. // See Search for usage and error information.
  16. //
  17. // Creating a request object using this method should be used when you want to inject
  18. // custom logic into the request's lifecycle using a custom handler, or if you want to
  19. // access properties on the request object before or after sending the request. If
  20. // you just want the service response, call the Search method directly
  21. // instead.
  22. //
  23. // Note: You must call the "Send" method on the returned request object in order
  24. // to execute the request.
  25. //
  26. // // Example sending a request using the SearchRequest method.
  27. // req, resp := client.SearchRequest(params)
  28. //
  29. // err := req.Send()
  30. // if err == nil { // resp is now filled
  31. // fmt.Println(resp)
  32. // }
  33. //
  34. func (c *CloudSearchDomain) SearchRequest(input *SearchInput) (req *request.Request, output *SearchOutput) {
  35. op := &request.Operation{
  36. Name: opSearch,
  37. HTTPMethod: "GET",
  38. HTTPPath: "/2013-01-01/search?format=sdk&pretty=true",
  39. }
  40. if input == nil {
  41. input = &SearchInput{}
  42. }
  43. req = c.newRequest(op, input, output)
  44. output = &SearchOutput{}
  45. req.Data = output
  46. return
  47. }
  48. // Search API operation for Amazon CloudSearch Domain.
  49. //
  50. // Retrieves a list of documents that match the specified search criteria. How
  51. // you specify the search criteria depends on which query parser you use. Amazon
  52. // CloudSearch supports four query parsers:
  53. //
  54. // * simple: search all text and text-array fields for the specified string.
  55. // Search for phrases, individual terms, and prefixes.
  56. // * structured: search specific fields, construct compound queries using
  57. // Boolean operators, and use advanced features such as term boosting and
  58. // proximity searching.
  59. // * lucene: specify search criteria using the Apache Lucene query parser
  60. // syntax.
  61. // * dismax: specify search criteria using the simplified subset of the Apache
  62. // Lucene query parser syntax defined by the DisMax query parser.
  63. // For more information, see Searching Your Data (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching.html)
  64. // in the Amazon CloudSearch Developer Guide.
  65. //
  66. // The endpoint for submitting Search requests is domain-specific. You submit
  67. // search requests to a domain's search endpoint. To get the search endpoint
  68. // for your domain, use the Amazon CloudSearch configuration service DescribeDomains
  69. // action. A domain's endpoints are also displayed on the domain dashboard in
  70. // the Amazon CloudSearch console.
  71. //
  72. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  73. // with awserr.Error's Code and Message methods to get detailed information about
  74. // the error.
  75. //
  76. // See the AWS API reference guide for Amazon CloudSearch Domain's
  77. // API operation Search for usage and error information.
  78. //
  79. // Returned Error Codes:
  80. // * SearchException
  81. // Information about any problems encountered while processing a search request.
  82. //
  83. func (c *CloudSearchDomain) Search(input *SearchInput) (*SearchOutput, error) {
  84. req, out := c.SearchRequest(input)
  85. err := req.Send()
  86. return out, err
  87. }
  88. const opSuggest = "Suggest"
  89. // SuggestRequest generates a "aws/request.Request" representing the
  90. // client's request for the Suggest operation. The "output" return
  91. // value can be used to capture response data after the request's "Send" method
  92. // is called.
  93. //
  94. // See Suggest for usage and error information.
  95. //
  96. // Creating a request object using this method should be used when you want to inject
  97. // custom logic into the request's lifecycle using a custom handler, or if you want to
  98. // access properties on the request object before or after sending the request. If
  99. // you just want the service response, call the Suggest method directly
  100. // instead.
  101. //
  102. // Note: You must call the "Send" method on the returned request object in order
  103. // to execute the request.
  104. //
  105. // // Example sending a request using the SuggestRequest method.
  106. // req, resp := client.SuggestRequest(params)
  107. //
  108. // err := req.Send()
  109. // if err == nil { // resp is now filled
  110. // fmt.Println(resp)
  111. // }
  112. //
  113. func (c *CloudSearchDomain) SuggestRequest(input *SuggestInput) (req *request.Request, output *SuggestOutput) {
  114. op := &request.Operation{
  115. Name: opSuggest,
  116. HTTPMethod: "GET",
  117. HTTPPath: "/2013-01-01/suggest?format=sdk&pretty=true",
  118. }
  119. if input == nil {
  120. input = &SuggestInput{}
  121. }
  122. req = c.newRequest(op, input, output)
  123. output = &SuggestOutput{}
  124. req.Data = output
  125. return
  126. }
  127. // Suggest API operation for Amazon CloudSearch Domain.
  128. //
  129. // Retrieves autocomplete suggestions for a partial query string. You can use
  130. // suggestions enable you to display likely matches before users finish typing.
  131. // In Amazon CloudSearch, suggestions are based on the contents of a particular
  132. // text field. When you request suggestions, Amazon CloudSearch finds all of
  133. // the documents whose values in the suggester field start with the specified
  134. // query string. The beginning of the field must match the query string to be
  135. // considered a match.
  136. //
  137. // For more information about configuring suggesters and retrieving suggestions,
  138. // see Getting Suggestions (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/getting-suggestions.html)
  139. // in the Amazon CloudSearch Developer Guide.
  140. //
  141. // The endpoint for submitting Suggest requests is domain-specific. You submit
  142. // suggest requests to a domain's search endpoint. To get the search endpoint
  143. // for your domain, use the Amazon CloudSearch configuration service DescribeDomains
  144. // action. A domain's endpoints are also displayed on the domain dashboard in
  145. // the Amazon CloudSearch console.
  146. //
  147. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  148. // with awserr.Error's Code and Message methods to get detailed information about
  149. // the error.
  150. //
  151. // See the AWS API reference guide for Amazon CloudSearch Domain's
  152. // API operation Suggest for usage and error information.
  153. //
  154. // Returned Error Codes:
  155. // * SearchException
  156. // Information about any problems encountered while processing a search request.
  157. //
  158. func (c *CloudSearchDomain) Suggest(input *SuggestInput) (*SuggestOutput, error) {
  159. req, out := c.SuggestRequest(input)
  160. err := req.Send()
  161. return out, err
  162. }
  163. const opUploadDocuments = "UploadDocuments"
  164. // UploadDocumentsRequest generates a "aws/request.Request" representing the
  165. // client's request for the UploadDocuments operation. The "output" return
  166. // value can be used to capture response data after the request's "Send" method
  167. // is called.
  168. //
  169. // See UploadDocuments for usage and error information.
  170. //
  171. // Creating a request object using this method should be used when you want to inject
  172. // custom logic into the request's lifecycle using a custom handler, or if you want to
  173. // access properties on the request object before or after sending the request. If
  174. // you just want the service response, call the UploadDocuments method directly
  175. // instead.
  176. //
  177. // Note: You must call the "Send" method on the returned request object in order
  178. // to execute the request.
  179. //
  180. // // Example sending a request using the UploadDocumentsRequest method.
  181. // req, resp := client.UploadDocumentsRequest(params)
  182. //
  183. // err := req.Send()
  184. // if err == nil { // resp is now filled
  185. // fmt.Println(resp)
  186. // }
  187. //
  188. func (c *CloudSearchDomain) UploadDocumentsRequest(input *UploadDocumentsInput) (req *request.Request, output *UploadDocumentsOutput) {
  189. op := &request.Operation{
  190. Name: opUploadDocuments,
  191. HTTPMethod: "POST",
  192. HTTPPath: "/2013-01-01/documents/batch?format=sdk",
  193. }
  194. if input == nil {
  195. input = &UploadDocumentsInput{}
  196. }
  197. req = c.newRequest(op, input, output)
  198. output = &UploadDocumentsOutput{}
  199. req.Data = output
  200. return
  201. }
  202. // UploadDocuments API operation for Amazon CloudSearch Domain.
  203. //
  204. // Posts a batch of documents to a search domain for indexing. A document batch
  205. // is a collection of add and delete operations that represent the documents
  206. // you want to add, update, or delete from your domain. Batches can be described
  207. // in either JSON or XML. Each item that you want Amazon CloudSearch to return
  208. // as a search result (such as a product) is represented as a document. Every
  209. // document has a unique ID and one or more fields that contain the data that
  210. // you want to search and return in results. Individual documents cannot contain
  211. // more than 1 MB of data. The entire batch cannot exceed 5 MB. To get the best
  212. // possible upload performance, group add and delete operations in batches that
  213. // are close the 5 MB limit. Submitting a large volume of single-document batches
  214. // can overload a domain's document service.
  215. //
  216. // The endpoint for submitting UploadDocuments requests is domain-specific.
  217. // To get the document endpoint for your domain, use the Amazon CloudSearch
  218. // configuration service DescribeDomains action. A domain's endpoints are also
  219. // displayed on the domain dashboard in the Amazon CloudSearch console.
  220. //
  221. // For more information about formatting your data for Amazon CloudSearch, see
  222. // Preparing Your Data (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/preparing-data.html)
  223. // in the Amazon CloudSearch Developer Guide. For more information about uploading
  224. // data for indexing, see Uploading Data (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/uploading-data.html)
  225. // in the Amazon CloudSearch Developer Guide.
  226. //
  227. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  228. // with awserr.Error's Code and Message methods to get detailed information about
  229. // the error.
  230. //
  231. // See the AWS API reference guide for Amazon CloudSearch Domain's
  232. // API operation UploadDocuments for usage and error information.
  233. //
  234. // Returned Error Codes:
  235. // * DocumentServiceException
  236. // Information about any problems encountered while processing an upload request.
  237. //
  238. func (c *CloudSearchDomain) UploadDocuments(input *UploadDocumentsInput) (*UploadDocumentsOutput, error) {
  239. req, out := c.UploadDocumentsRequest(input)
  240. err := req.Send()
  241. return out, err
  242. }
  243. // A container for facet information.
  244. type Bucket struct {
  245. _ struct{} `type:"structure"`
  246. // The number of hits that contain the facet value in the specified facet field.
  247. Count *int64 `locationName:"count" type:"long"`
  248. // The facet value being counted.
  249. Value *string `locationName:"value" type:"string"`
  250. }
  251. // String returns the string representation
  252. func (s Bucket) String() string {
  253. return awsutil.Prettify(s)
  254. }
  255. // GoString returns the string representation
  256. func (s Bucket) GoString() string {
  257. return s.String()
  258. }
  259. // A container for the calculated facet values and counts.
  260. type BucketInfo struct {
  261. _ struct{} `type:"structure"`
  262. // A list of the calculated facet values and counts.
  263. Buckets []*Bucket `locationName:"buckets" type:"list"`
  264. }
  265. // String returns the string representation
  266. func (s BucketInfo) String() string {
  267. return awsutil.Prettify(s)
  268. }
  269. // GoString returns the string representation
  270. func (s BucketInfo) GoString() string {
  271. return s.String()
  272. }
  273. // A warning returned by the document service when an issue is discovered while
  274. // processing an upload request.
  275. type DocumentServiceWarning struct {
  276. _ struct{} `type:"structure"`
  277. // The description for a warning returned by the document service.
  278. Message *string `locationName:"message" type:"string"`
  279. }
  280. // String returns the string representation
  281. func (s DocumentServiceWarning) String() string {
  282. return awsutil.Prettify(s)
  283. }
  284. // GoString returns the string representation
  285. func (s DocumentServiceWarning) GoString() string {
  286. return s.String()
  287. }
  288. // The statistics for a field calculated in the request.
  289. type FieldStats struct {
  290. _ struct{} `type:"structure"`
  291. // The number of documents that contain a value in the specified field in the
  292. // result set.
  293. Count *int64 `locationName:"count" type:"long"`
  294. // The maximum value found in the specified field in the result set.
  295. //
  296. // If the field is numeric (int, int-array, double, or double-array), max is
  297. // the string representation of a double-precision 64-bit floating point value.
  298. // If the field is date or date-array, max is the string representation of a
  299. // date with the format specified in IETF RFC3339 (http://tools.ietf.org/html/rfc3339):
  300. // yyyy-mm-ddTHH:mm:ss.SSSZ.
  301. Max *string `locationName:"max" type:"string"`
  302. // The average of the values found in the specified field in the result set.
  303. //
  304. // If the field is numeric (int, int-array, double, or double-array), mean is
  305. // the string representation of a double-precision 64-bit floating point value.
  306. // If the field is date or date-array, mean is the string representation of
  307. // a date with the format specified in IETF RFC3339 (http://tools.ietf.org/html/rfc3339):
  308. // yyyy-mm-ddTHH:mm:ss.SSSZ.
  309. Mean *string `locationName:"mean" type:"string"`
  310. // The minimum value found in the specified field in the result set.
  311. //
  312. // If the field is numeric (int, int-array, double, or double-array), min is
  313. // the string representation of a double-precision 64-bit floating point value.
  314. // If the field is date or date-array, min is the string representation of a
  315. // date with the format specified in IETF RFC3339 (http://tools.ietf.org/html/rfc3339):
  316. // yyyy-mm-ddTHH:mm:ss.SSSZ.
  317. Min *string `locationName:"min" type:"string"`
  318. // The number of documents that do not contain a value in the specified field
  319. // in the result set.
  320. Missing *int64 `locationName:"missing" type:"long"`
  321. // The standard deviation of the values in the specified field in the result
  322. // set.
  323. Stddev *float64 `locationName:"stddev" type:"double"`
  324. // The sum of the field values across the documents in the result set. null
  325. // for date fields.
  326. Sum *float64 `locationName:"sum" type:"double"`
  327. // The sum of all field values in the result set squared.
  328. SumOfSquares *float64 `locationName:"sumOfSquares" type:"double"`
  329. }
  330. // String returns the string representation
  331. func (s FieldStats) String() string {
  332. return awsutil.Prettify(s)
  333. }
  334. // GoString returns the string representation
  335. func (s FieldStats) GoString() string {
  336. return s.String()
  337. }
  338. // Information about a document that matches the search request.
  339. type Hit struct {
  340. _ struct{} `type:"structure"`
  341. // The expressions returned from a document that matches the search request.
  342. Exprs map[string]*string `locationName:"exprs" type:"map"`
  343. // The fields returned from a document that matches the search request.
  344. Fields map[string][]*string `locationName:"fields" type:"map"`
  345. // The highlights returned from a document that matches the search request.
  346. Highlights map[string]*string `locationName:"highlights" type:"map"`
  347. // The document ID of a document that matches the search request.
  348. Id *string `locationName:"id" type:"string"`
  349. }
  350. // String returns the string representation
  351. func (s Hit) String() string {
  352. return awsutil.Prettify(s)
  353. }
  354. // GoString returns the string representation
  355. func (s Hit) GoString() string {
  356. return s.String()
  357. }
  358. // The collection of documents that match the search request.
  359. type Hits struct {
  360. _ struct{} `type:"structure"`
  361. // A cursor that can be used to retrieve the next set of matching documents
  362. // when you want to page through a large result set.
  363. Cursor *string `locationName:"cursor" type:"string"`
  364. // The total number of documents that match the search request.
  365. Found *int64 `locationName:"found" type:"long"`
  366. // A document that matches the search request.
  367. Hit []*Hit `locationName:"hit" type:"list"`
  368. // The index of the first matching document.
  369. Start *int64 `locationName:"start" type:"long"`
  370. }
  371. // String returns the string representation
  372. func (s Hits) String() string {
  373. return awsutil.Prettify(s)
  374. }
  375. // GoString returns the string representation
  376. func (s Hits) GoString() string {
  377. return s.String()
  378. }
  379. // Container for the parameters to the Search request.
  380. type SearchInput struct {
  381. _ struct{} `type:"structure"`
  382. // Retrieves a cursor value you can use to page through large result sets. Use
  383. // the size parameter to control the number of hits to include in each response.
  384. // You can specify either the cursor or start parameter in a request; they are
  385. // mutually exclusive. To get the first cursor, set the cursor value to initial.
  386. // In subsequent requests, specify the cursor value returned in the hits section
  387. // of the response.
  388. //
  389. // For more information, see Paginating Results (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/paginating-results.html)
  390. // in the Amazon CloudSearch Developer Guide.
  391. Cursor *string `location:"querystring" locationName:"cursor" type:"string"`
  392. // Defines one or more numeric expressions that can be used to sort results
  393. // or specify search or filter criteria. You can also specify expressions as
  394. // return fields.
  395. //
  396. // You specify the expressions in JSON using the form {"EXPRESSIONNAME":"EXPRESSION"}.
  397. // You can define and use multiple expressions in a search request. For example:
  398. //
  399. // {"expression1":"_score*rating", "expression2":"(1/rank)*year"}
  400. //
  401. // For information about the variables, operators, and functions you can use
  402. // in expressions, see Writing Expressions (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-expressions.html#writing-expressions)
  403. // in the Amazon CloudSearch Developer Guide.
  404. Expr *string `location:"querystring" locationName:"expr" type:"string"`
  405. // Specifies one or more fields for which to get facet information, and options
  406. // that control how the facet information is returned. Each specified field
  407. // must be facet-enabled in the domain configuration. The fields and options
  408. // are specified in JSON using the form {"FIELD":{"OPTION":VALUE,"OPTION:"STRING"},"FIELD":{"OPTION":VALUE,"OPTION":"STRING"}}.
  409. //
  410. // You can specify the following faceting options:
  411. //
  412. // * buckets specifies an array of the facet values or ranges to count. Ranges
  413. // are specified using the same syntax that you use to search for a range
  414. // of values. For more information, see Searching for a Range of Values
  415. // (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-ranges.html)
  416. // in the Amazon CloudSearch Developer Guide. Buckets are returned in the
  417. // order they are specified in the request. The sort and size options are
  418. // not valid if you specify buckets.
  419. //
  420. // * size specifies the maximum number of facets to include in the results.
  421. // By default, Amazon CloudSearch returns counts for the top 10. The size
  422. // parameter is only valid when you specify the sort option; it cannot be
  423. // used in conjunction with buckets.
  424. //
  425. // * sort specifies how you want to sort the facets in the results: bucket
  426. // or count. Specify bucket to sort alphabetically or numerically by facet
  427. // value (in ascending order). Specify count to sort by the facet counts
  428. // computed for each facet value (in descending order). To retrieve facet
  429. // counts for particular values or ranges of values, use the buckets option
  430. // instead of sort.
  431. //
  432. // If no facet options are specified, facet counts are computed for all field
  433. // values, the facets are sorted by facet count, and the top 10 facets are returned
  434. // in the results.
  435. //
  436. // To count particular buckets of values, use the buckets option. For example,
  437. // the following request uses the buckets option to calculate and return facet
  438. // counts by decade.
  439. //
  440. // {"year":{"buckets":["[1970,1979]","[1980,1989]","[1990,1999]","[2000,2009]","[2010,}"]}}
  441. //
  442. // To sort facets by facet count, use the count option. For example, the following
  443. // request sets the sort option to count to sort the facet values by facet count,
  444. // with the facet values that have the most matching documents listed first.
  445. // Setting the size option to 3 returns only the top three facet values.
  446. //
  447. // {"year":{"sort":"count","size":3}}
  448. //
  449. // To sort the facets by value, use the bucket option. For example, the following
  450. // request sets the sort option to bucket to sort the facet values numerically
  451. // by year, with earliest year listed first.
  452. //
  453. // {"year":{"sort":"bucket"}}
  454. //
  455. // For more information, see Getting and Using Facet Information (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/faceting.html)
  456. // in the Amazon CloudSearch Developer Guide.
  457. Facet *string `location:"querystring" locationName:"facet" type:"string"`
  458. // Specifies a structured query that filters the results of a search without
  459. // affecting how the results are scored and sorted. You use filterQuery in conjunction
  460. // with the query parameter to filter the documents that match the constraints
  461. // specified in the query parameter. Specifying a filter controls only which
  462. // matching documents are included in the results, it has no effect on how they
  463. // are scored and sorted. The filterQuery parameter supports the full structured
  464. // query syntax.
  465. //
  466. // For more information about using filters, see Filtering Matching Documents
  467. // (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/filtering-results.html)
  468. // in the Amazon CloudSearch Developer Guide.
  469. FilterQuery *string `location:"querystring" locationName:"fq" type:"string"`
  470. // Retrieves highlights for matches in the specified text or text-array fields.
  471. // Each specified field must be highlight enabled in the domain configuration.
  472. // The fields and options are specified in JSON using the form {"FIELD":{"OPTION":VALUE,"OPTION:"STRING"},"FIELD":{"OPTION":VALUE,"OPTION":"STRING"}}.
  473. //
  474. // You can specify the following highlight options:
  475. //
  476. // * format: specifies the format of the data in the text field: text or
  477. // html. When data is returned as HTML, all non-alphanumeric characters are
  478. // encoded. The default is html.
  479. // * max_phrases: specifies the maximum number of occurrences of the search
  480. // term(s) you want to highlight. By default, the first occurrence is highlighted.
  481. //
  482. // * pre_tag: specifies the string to prepend to an occurrence of a search
  483. // term. The default for HTML highlights is <em>. The default for text
  484. // highlights is *.
  485. // * post_tag: specifies the string to append to an occurrence of a search
  486. // term. The default for HTML highlights is </em>. The default for
  487. // text highlights is *.
  488. // If no highlight options are specified for a field, the returned field text
  489. // is treated as HTML and the first match is highlighted with emphasis tags:
  490. // <em>search-term</em>.
  491. //
  492. // For example, the following request retrieves highlights for the actors and
  493. // title fields.
  494. //
  495. // { "actors": {}, "title": {"format": "text","max_phrases": 2,"pre_tag": "","post_tag":
  496. // ""} }
  497. Highlight *string `location:"querystring" locationName:"highlight" type:"string"`
  498. // Enables partial results to be returned if one or more index partitions are
  499. // unavailable. When your search index is partitioned across multiple search
  500. // instances, by default Amazon CloudSearch only returns results if every partition
  501. // can be queried. This means that the failure of a single search instance can
  502. // result in 5xx (internal server) errors. When you enable partial results,
  503. // Amazon CloudSearch returns whatever results are available and includes the
  504. // percentage of documents searched in the search results (percent-searched).
  505. // This enables you to more gracefully degrade your users' search experience.
  506. // For example, rather than displaying no results, you could display the partial
  507. // results and a message indicating that the results might be incomplete due
  508. // to a temporary system outage.
  509. Partial *bool `location:"querystring" locationName:"partial" type:"boolean"`
  510. // Specifies the search criteria for the request. How you specify the search
  511. // criteria depends on the query parser used for the request and the parser
  512. // options specified in the queryOptions parameter. By default, the simple query
  513. // parser is used to process requests. To use the structured, lucene, or dismax
  514. // query parser, you must also specify the queryParser parameter.
  515. //
  516. // For more information about specifying search criteria, see Searching Your
  517. // Data (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching.html)
  518. // in the Amazon CloudSearch Developer Guide.
  519. //
  520. // Query is a required field
  521. Query *string `location:"querystring" locationName:"q" type:"string" required:"true"`
  522. // Configures options for the query parser specified in the queryParser parameter.
  523. // You specify the options in JSON using the following form {"OPTION1":"VALUE1","OPTION2":VALUE2"..."OPTIONN":"VALUEN"}.
  524. //
  525. // The options you can configure vary according to which parser you use:
  526. //
  527. // * defaultOperator: The default operator used to combine individual terms
  528. // in the search string. For example: defaultOperator: 'or'. For the dismax
  529. // parser, you specify a percentage that represents the percentage of terms
  530. // in the search string (rounded down) that must match, rather than a default
  531. // operator. A value of 0% is the equivalent to OR, and a value of 100% is
  532. // equivalent to AND. The percentage must be specified as a value in the
  533. // range 0-100 followed by the percent (%) symbol. For example, defaultOperator:
  534. // 50%. Valid values: and, or, a percentage in the range 0%-100% (dismax).
  535. // Default: and (simple, structured, lucene) or 100 (dismax). Valid for:
  536. // simple, structured, lucene, and dismax.
  537. // * fields: An array of the fields to search when no fields are specified
  538. // in a search. If no fields are specified in a search and this option is
  539. // not specified, all text and text-array fields are searched. You can specify
  540. // a weight for each field to control the relative importance of each field
  541. // when Amazon CloudSearch calculates relevance scores. To specify a field
  542. // weight, append a caret (^) symbol and the weight to the field name. For
  543. // example, to boost the importance of the title field over the description
  544. // field you could specify: "fields":["title^5","description"]. Valid values:
  545. // The name of any configured field and an optional numeric value greater
  546. // than zero. Default: All text and text-array fields. Valid for: simple,
  547. // structured, lucene, and dismax.
  548. // * operators: An array of the operators or special characters you want
  549. // to disable for the simple query parser. If you disable the and, or, or
  550. // not operators, the corresponding operators (+, |, -) have no special meaning
  551. // and are dropped from the search string. Similarly, disabling prefix disables
  552. // the wildcard operator (*) and disabling phrase disables the ability to
  553. // search for phrases by enclosing phrases in double quotes. Disabling precedence
  554. // disables the ability to control order of precedence using parentheses.
  555. // Disabling near disables the ability to use the ~ operator to perform a
  556. // sloppy phrase search. Disabling the fuzzy operator disables the ability
  557. // to use the ~ operator to perform a fuzzy search. escape disables the ability
  558. // to use a backslash (\) to escape special characters within the search
  559. // string. Disabling whitespace is an advanced option that prevents the parser
  560. // from tokenizing on whitespace, which can be useful for Vietnamese. (It
  561. // prevents Vietnamese words from being split incorrectly.) For example,
  562. // you could disable all operators other than the phrase operator to support
  563. // just simple term and phrase queries: "operators":["and","not","or", "prefix"].
  564. // Valid values: and, escape, fuzzy, near, not, or, phrase, precedence, prefix,
  565. // whitespace. Default: All operators and special characters are enabled.
  566. // Valid for: simple.
  567. // * phraseFields: An array of the text or text-array fields you want to
  568. // use for phrase searches. When the terms in the search string appear in
  569. // close proximity within a field, the field scores higher. You can specify
  570. // a weight for each field to boost that score. The phraseSlop option controls
  571. // how much the matches can deviate from the search string and still be boosted.
  572. // To specify a field weight, append a caret (^) symbol and the weight to
  573. // the field name. For example, to boost phrase matches in the title field
  574. // over the abstract field, you could specify: "phraseFields":["title^3",
  575. // "plot"] Valid values: The name of any text or text-array field and an
  576. // optional numeric value greater than zero. Default: No fields. If you don't
  577. // specify any fields with phraseFields, proximity scoring is disabled even
  578. // if phraseSlop is specified. Valid for: dismax.
  579. // * phraseSlop: An integer value that specifies how much matches can deviate
  580. // from the search phrase and still be boosted according to the weights specified
  581. // in the phraseFields option; for example, phraseSlop: 2. You must also
  582. // specify phraseFields to enable proximity scoring. Valid values: positive
  583. // integers. Default: 0. Valid for: dismax.
  584. // * explicitPhraseSlop: An integer value that specifies how much a match
  585. // can deviate from the search phrase when the phrase is enclosed in double
  586. // quotes in the search string. (Phrases that exceed this proximity distance
  587. // are not considered a match.) For example, to specify a slop of three for
  588. // dismax phrase queries, you would specify "explicitPhraseSlop":3. Valid
  589. // values: positive integers. Default: 0. Valid for: dismax.
  590. // * tieBreaker: When a term in the search string is found in a document's
  591. // field, a score is calculated for that field based on how common the word
  592. // is in that field compared to other documents. If the term occurs in multiple
  593. // fields within a document, by default only the highest scoring field contributes
  594. // to the document's overall score. You can specify a tieBreaker value to
  595. // enable the matches in lower-scoring fields to contribute to the document's
  596. // score. That way, if two documents have the same max field score for a
  597. // particular term, the score for the document that has matches in more fields
  598. // will be higher. The formula for calculating the score with a tieBreaker
  599. // is (max field score) + (tieBreaker) * (sum of the scores for the rest
  600. // of the matching fields). Set tieBreaker to 0 to disregard all but the
  601. // highest scoring field (pure max): "tieBreaker":0. Set to 1 to sum the
  602. // scores from all fields (pure sum): "tieBreaker":1. Valid values: 0.0 to
  603. // 1.0. Default: 0.0. Valid for: dismax.
  604. QueryOptions *string `location:"querystring" locationName:"q.options" type:"string"`
  605. // Specifies which query parser to use to process the request. If queryParser
  606. // is not specified, Amazon CloudSearch uses the simple query parser.
  607. //
  608. // Amazon CloudSearch supports four query parsers:
  609. //
  610. // * simple: perform simple searches of text and text-array fields. By default,
  611. // the simple query parser searches all text and text-array fields. You can
  612. // specify which fields to search by with the queryOptions parameter. If
  613. // you prefix a search term with a plus sign (+) documents must contain the
  614. // term to be considered a match. (This is the default, unless you configure
  615. // the default operator with the queryOptions parameter.) You can use the
  616. // - (NOT), | (OR), and * (wildcard) operators to exclude particular terms,
  617. // find results that match any of the specified terms, or search for a prefix.
  618. // To search for a phrase rather than individual terms, enclose the phrase
  619. // in double quotes. For more information, see Searching for Text (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-text.html)
  620. // in the Amazon CloudSearch Developer Guide.
  621. // * structured: perform advanced searches by combining multiple expressions
  622. // to define the search criteria. You can also search within particular fields,
  623. // search for values and ranges of values, and use advanced options such
  624. // as term boosting, matchall, and near. For more information, see Constructing
  625. // Compound Queries (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-compound-queries.html)
  626. // in the Amazon CloudSearch Developer Guide.
  627. // * lucene: search using the Apache Lucene query parser syntax. For more
  628. // 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).
  629. //
  630. // * dismax: search using the simplified subset of the Apache Lucene query
  631. // parser syntax defined by the DisMax query parser. For more information,
  632. // see DisMax Query Parser Syntax (http://wiki.apache.org/solr/DisMaxQParserPlugin#Query_Syntax).
  633. //
  634. QueryParser *string `location:"querystring" locationName:"q.parser" type:"string" enum:"QueryParser"`
  635. // Specifies the field and expression values to include in the response. Multiple
  636. // fields or expressions are specified as a comma-separated list. By default,
  637. // a search response includes all return enabled fields (_all_fields). To return
  638. // only the document IDs for the matching documents, specify _no_fields. To
  639. // retrieve the relevance score calculated for each document, specify _score.
  640. Return *string `location:"querystring" locationName:"return" type:"string"`
  641. // Specifies the maximum number of search hits to include in the response.
  642. Size *int64 `location:"querystring" locationName:"size" type:"long"`
  643. // Specifies the fields or custom expressions to use to sort the search results.
  644. // Multiple fields or expressions are specified as a comma-separated list. You
  645. // must specify the sort direction (asc or desc) for each field; for example,
  646. // year desc,title asc. To use a field to sort results, the field must be sort-enabled
  647. // in the domain configuration. Array type fields cannot be used for sorting.
  648. // If no sort parameter is specified, results are sorted by their default relevance
  649. // scores in descending order: _score desc. You can also sort by document ID
  650. // (_id asc) and version (_version desc).
  651. //
  652. // For more information, see Sorting Results (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/sorting-results.html)
  653. // in the Amazon CloudSearch Developer Guide.
  654. Sort *string `location:"querystring" locationName:"sort" type:"string"`
  655. // Specifies the offset of the first search hit you want to return. Note that
  656. // the result set is zero-based; the first result is at index 0. You can specify
  657. // either the start or cursor parameter in a request, they are mutually exclusive.
  658. //
  659. // For more information, see Paginating Results (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/paginating-results.html)
  660. // in the Amazon CloudSearch Developer Guide.
  661. Start *int64 `location:"querystring" locationName:"start" type:"long"`
  662. // Specifies one or more fields for which to get statistics information. Each
  663. // specified field must be facet-enabled in the domain configuration. The fields
  664. // are specified in JSON using the form:
  665. //
  666. // {"FIELD-A":{},"FIELD-B":{}}There are currently no options supported for statistics.
  667. Stats *string `location:"querystring" locationName:"stats" type:"string"`
  668. }
  669. // String returns the string representation
  670. func (s SearchInput) String() string {
  671. return awsutil.Prettify(s)
  672. }
  673. // GoString returns the string representation
  674. func (s SearchInput) GoString() string {
  675. return s.String()
  676. }
  677. // Validate inspects the fields of the type to determine if they are valid.
  678. func (s *SearchInput) Validate() error {
  679. invalidParams := request.ErrInvalidParams{Context: "SearchInput"}
  680. if s.Query == nil {
  681. invalidParams.Add(request.NewErrParamRequired("Query"))
  682. }
  683. if invalidParams.Len() > 0 {
  684. return invalidParams
  685. }
  686. return nil
  687. }
  688. // The result of a Search request. Contains the documents that match the specified
  689. // search criteria and any requested fields, highlights, and facet information.
  690. type SearchOutput struct {
  691. _ struct{} `type:"structure"`
  692. // The requested facet information.
  693. Facets map[string]*BucketInfo `locationName:"facets" type:"map"`
  694. // The documents that match the search criteria.
  695. Hits *Hits `locationName:"hits" type:"structure"`
  696. // The requested field statistics information.
  697. Stats map[string]*FieldStats `locationName:"stats" type:"map"`
  698. // The status information returned for the search request.
  699. Status *SearchStatus `locationName:"status" type:"structure"`
  700. }
  701. // String returns the string representation
  702. func (s SearchOutput) String() string {
  703. return awsutil.Prettify(s)
  704. }
  705. // GoString returns the string representation
  706. func (s SearchOutput) GoString() string {
  707. return s.String()
  708. }
  709. // Contains the resource id (rid) and the time it took to process the request
  710. // (timems).
  711. type SearchStatus struct {
  712. _ struct{} `type:"structure"`
  713. // The encrypted resource ID for the request.
  714. Rid *string `locationName:"rid" type:"string"`
  715. // How long it took to process the request, in milliseconds.
  716. Timems *int64 `locationName:"timems" type:"long"`
  717. }
  718. // String returns the string representation
  719. func (s SearchStatus) String() string {
  720. return awsutil.Prettify(s)
  721. }
  722. // GoString returns the string representation
  723. func (s SearchStatus) GoString() string {
  724. return s.String()
  725. }
  726. // Container for the parameters to the Suggest request.
  727. type SuggestInput struct {
  728. _ struct{} `type:"structure"`
  729. // Specifies the string for which you want to get suggestions.
  730. //
  731. // Query is a required field
  732. Query *string `location:"querystring" locationName:"q" type:"string" required:"true"`
  733. // Specifies the maximum number of suggestions to return.
  734. Size *int64 `location:"querystring" locationName:"size" type:"long"`
  735. // Specifies the name of the suggester to use to find suggested matches.
  736. //
  737. // Suggester is a required field
  738. Suggester *string `location:"querystring" locationName:"suggester" type:"string" required:"true"`
  739. }
  740. // String returns the string representation
  741. func (s SuggestInput) String() string {
  742. return awsutil.Prettify(s)
  743. }
  744. // GoString returns the string representation
  745. func (s SuggestInput) GoString() string {
  746. return s.String()
  747. }
  748. // Validate inspects the fields of the type to determine if they are valid.
  749. func (s *SuggestInput) Validate() error {
  750. invalidParams := request.ErrInvalidParams{Context: "SuggestInput"}
  751. if s.Query == nil {
  752. invalidParams.Add(request.NewErrParamRequired("Query"))
  753. }
  754. if s.Suggester == nil {
  755. invalidParams.Add(request.NewErrParamRequired("Suggester"))
  756. }
  757. if invalidParams.Len() > 0 {
  758. return invalidParams
  759. }
  760. return nil
  761. }
  762. // Container for the suggestion information returned in a SuggestResponse.
  763. type SuggestModel struct {
  764. _ struct{} `type:"structure"`
  765. // The number of documents that were found to match the query string.
  766. Found *int64 `locationName:"found" type:"long"`
  767. // The query string specified in the suggest request.
  768. Query *string `locationName:"query" type:"string"`
  769. // The documents that match the query string.
  770. Suggestions []*SuggestionMatch `locationName:"suggestions" type:"list"`
  771. }
  772. // String returns the string representation
  773. func (s SuggestModel) String() string {
  774. return awsutil.Prettify(s)
  775. }
  776. // GoString returns the string representation
  777. func (s SuggestModel) GoString() string {
  778. return s.String()
  779. }
  780. // Contains the response to a Suggest request.
  781. type SuggestOutput struct {
  782. _ struct{} `type:"structure"`
  783. // The status of a SuggestRequest. Contains the resource ID (rid) and how long
  784. // it took to process the request (timems).
  785. Status *SuggestStatus `locationName:"status" type:"structure"`
  786. // Container for the matching search suggestion information.
  787. Suggest *SuggestModel `locationName:"suggest" type:"structure"`
  788. }
  789. // String returns the string representation
  790. func (s SuggestOutput) String() string {
  791. return awsutil.Prettify(s)
  792. }
  793. // GoString returns the string representation
  794. func (s SuggestOutput) GoString() string {
  795. return s.String()
  796. }
  797. // Contains the resource id (rid) and the time it took to process the request
  798. // (timems).
  799. type SuggestStatus struct {
  800. _ struct{} `type:"structure"`
  801. // The encrypted resource ID for the request.
  802. Rid *string `locationName:"rid" type:"string"`
  803. // How long it took to process the request, in milliseconds.
  804. Timems *int64 `locationName:"timems" type:"long"`
  805. }
  806. // String returns the string representation
  807. func (s SuggestStatus) String() string {
  808. return awsutil.Prettify(s)
  809. }
  810. // GoString returns the string representation
  811. func (s SuggestStatus) GoString() string {
  812. return s.String()
  813. }
  814. // An autocomplete suggestion that matches the query string specified in a SuggestRequest.
  815. type SuggestionMatch struct {
  816. _ struct{} `type:"structure"`
  817. // The document ID of the suggested document.
  818. Id *string `locationName:"id" type:"string"`
  819. // The relevance score of a suggested match.
  820. Score *int64 `locationName:"score" type:"long"`
  821. // The string that matches the query string specified in the SuggestRequest.
  822. Suggestion *string `locationName:"suggestion" type:"string"`
  823. }
  824. // String returns the string representation
  825. func (s SuggestionMatch) String() string {
  826. return awsutil.Prettify(s)
  827. }
  828. // GoString returns the string representation
  829. func (s SuggestionMatch) GoString() string {
  830. return s.String()
  831. }
  832. // Container for the parameters to the UploadDocuments request.
  833. type UploadDocumentsInput struct {
  834. _ struct{} `type:"structure" payload:"Documents"`
  835. // The format of the batch you are uploading. Amazon CloudSearch supports two
  836. // document batch formats:
  837. //
  838. // * application/json
  839. // * application/xml
  840. //
  841. // ContentType is a required field
  842. ContentType *string `location:"header" locationName:"Content-Type" type:"string" required:"true" enum:"ContentType"`
  843. // A batch of documents formatted in JSON or HTML.
  844. //
  845. // Documents is a required field
  846. Documents io.ReadSeeker `locationName:"documents" type:"blob" required:"true"`
  847. }
  848. // String returns the string representation
  849. func (s UploadDocumentsInput) String() string {
  850. return awsutil.Prettify(s)
  851. }
  852. // GoString returns the string representation
  853. func (s UploadDocumentsInput) GoString() string {
  854. return s.String()
  855. }
  856. // Validate inspects the fields of the type to determine if they are valid.
  857. func (s *UploadDocumentsInput) Validate() error {
  858. invalidParams := request.ErrInvalidParams{Context: "UploadDocumentsInput"}
  859. if s.ContentType == nil {
  860. invalidParams.Add(request.NewErrParamRequired("ContentType"))
  861. }
  862. if s.Documents == nil {
  863. invalidParams.Add(request.NewErrParamRequired("Documents"))
  864. }
  865. if invalidParams.Len() > 0 {
  866. return invalidParams
  867. }
  868. return nil
  869. }
  870. // Contains the response to an UploadDocuments request.
  871. type UploadDocumentsOutput struct {
  872. _ struct{} `type:"structure"`
  873. // The number of documents that were added to the search domain.
  874. Adds *int64 `locationName:"adds" type:"long"`
  875. // The number of documents that were deleted from the search domain.
  876. Deletes *int64 `locationName:"deletes" type:"long"`
  877. // The status of an UploadDocumentsRequest.
  878. Status *string `locationName:"status" type:"string"`
  879. // Any warnings returned by the document service about the documents being uploaded.
  880. Warnings []*DocumentServiceWarning `locationName:"warnings" type:"list"`
  881. }
  882. // String returns the string representation
  883. func (s UploadDocumentsOutput) String() string {
  884. return awsutil.Prettify(s)
  885. }
  886. // GoString returns the string representation
  887. func (s UploadDocumentsOutput) GoString() string {
  888. return s.String()
  889. }
  890. const (
  891. // ContentTypeApplicationJson is a ContentType enum value
  892. ContentTypeApplicationJson = "application/json"
  893. // ContentTypeApplicationXml is a ContentType enum value
  894. ContentTypeApplicationXml = "application/xml"
  895. )
  896. const (
  897. // QueryParserSimple is a QueryParser enum value
  898. QueryParserSimple = "simple"
  899. // QueryParserStructured is a QueryParser enum value
  900. QueryParserStructured = "structured"
  901. // QueryParserLucene is a QueryParser enum value
  902. QueryParserLucene = "lucene"
  903. // QueryParserDismax is a QueryParser enum value
  904. QueryParserDismax = "dismax"
  905. )