api.go 36 KB

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