api.go 41 KB

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