blib/lib/Paws/CloudSearchDomain/Search.pm untested

filter: Statementstmt 0.0% 0 / 38 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 40 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::CloudSearchDomain::Search;
3 use Moose;
4 has Cursor => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'cursor');
5 has Expr => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'expr');
6 has Facet => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'facet');
7 has FilterQuery => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'fq');
8 has Highlight => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'highlight');
9 has Partial => (is => 'ro', isa => 'Bool', traits => ['ParamInQuery'], query_name => 'partial');
10 has Query => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'q', required => 1);
11 has QueryOptions => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'q.options');
12 has QueryParser => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'q.parser');
13 has Return => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'return');
14 has Size => (is => 'ro', isa => 'Int', traits => ['ParamInQuery'], query_name => 'size');
15 has Sort => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'sort');
16 has Start => (is => 'ro', isa => 'Int', traits => ['ParamInQuery'], query_name => 'start');
17 has Stats => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'stats');
18  
19 use MooseX::ClassAttribute;
20  
21 class_has _api_call => (isa => 'Str', is => 'ro', default => 'Search');
22 class_has _api_uri => (isa => 'Str', is => 'ro', default => '/2013-01-01/search?format=sdk&pretty=true');
23 class_has _api_method => (isa => 'Str', is => 'ro', default => 'GET');
24 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::CloudSearchDomain::SearchResponse');
25 1;
26  
27 ### main pod documentation begin ###
28  
29 =head1 NAME
30  
31 Paws::CloudSearchDomain::Search - Arguments for method Search on L<Paws::CloudSearchDomain>
32  
33 =head1 DESCRIPTION
34  
35 This class represents the parameters used for calling the method Search on the
36 L<Amazon CloudSearch Domain|Paws::CloudSearchDomain> service. Use the attributes of this class
37 as arguments to method Search.
38  
39 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to Search.
40  
41 =head1 SYNOPSIS
42  
43 my $cloudsearchdomain = Paws->service('CloudSearchDomain');
44 my $SearchResponse = $cloudsearchdomain->Search(
45 Query => 'MyQuery',
46 Cursor => 'MyCursor', # OPTIONAL
47 Expr => 'MyExpr', # OPTIONAL
48 Facet => 'MyFacet', # OPTIONAL
49 FilterQuery => 'MyFilterQuery', # OPTIONAL
50 Highlight => 'MyHighlight', # OPTIONAL
51 Partial => 1, # OPTIONAL
52 QueryOptions => 'MyQueryOptions', # OPTIONAL
53 QueryParser => 'simple', # OPTIONAL
54 Return => 'MyReturn', # OPTIONAL
55 Size => 1, # OPTIONAL
56 Sort => 'MySort', # OPTIONAL
57 Start => 1, # OPTIONAL
58 Stats => 'MyStat', # OPTIONAL
59 );
60  
61 # Results:
62 my $Facets = $SearchResponse->Facets;
63 my $Hits = $SearchResponse->Hits;
64 my $Stats = $SearchResponse->Stats;
65 my $Status = $SearchResponse->Status;
66  
67 # Returns a L<Paws::CloudSearchDomain::SearchResponse> object.
68  
69 Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
70 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/cloudsearchdomain/Search>
71  
72 =head1 ATTRIBUTES
73  
74  
75 =head2 Cursor => Str
76  
77 Retrieves a cursor value you can use to page through large result sets.
78 Use the C<size> parameter to control the number of hits to include in
79 each response. You can specify either the C<cursor> or C<start>
80 parameter in a request; they are mutually exclusive. To get the first
81 cursor, set the cursor value to C<initial>. In subsequent requests,
82 specify the cursor value returned in the hits section of the response.
83  
84 For more information, see Paginating Results
85 (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/paginating-results.html)
86 in the I<Amazon CloudSearch Developer Guide>.
87  
88  
89  
90 =head2 Expr => Str
91  
92 Defines one or more numeric expressions that can be used to sort
93 results or specify search or filter criteria. You can also specify
94 expressions as return fields.
95  
96 You specify the expressions in JSON using the form
97 C<{"EXPRESSIONNAME":"EXPRESSION"}>. You can define and use multiple
98 expressions in a search request. For example:
99  
100 C<{"expression1":"_score*rating", "expression2":"(1/rank)*year"}>
101  
102 For information about the variables, operators, and functions you can
103 use in expressions, see Writing Expressions
104 (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-expressions.html#writing-expressions)
105 in the I<Amazon CloudSearch Developer Guide>.
106  
107  
108  
109 =head2 Facet => Str
110  
111 Specifies one or more fields for which to get facet information, and
112 options that control how the facet information is returned. Each
113 specified field must be facet-enabled in the domain configuration. The
114 fields and options are specified in JSON using the form
115 C<{"FIELD":{"OPTION":VALUE,"OPTION:"STRING"},"FIELD":{"OPTION":VALUE,"OPTION":"STRING"}}>.
116  
117 You can specify the following faceting options:
118  
119 =over
120  
121 =item *
122  
123 C<buckets> specifies an array of the facet values or ranges to count.
124 Ranges are specified using the same syntax that you use to search for a
125 range of values. For more information, see Searching for a Range of
126 Values
127 (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-ranges.html)
128 in the I<Amazon CloudSearch Developer Guide>. Buckets are returned in
129 the order they are specified in the request. The C<sort> and C<size>
130 options are not valid if you specify C<buckets>.
131  
132 =item *
133  
134 C<size> specifies the maximum number of facets to include in the
135 results. By default, Amazon CloudSearch returns counts for the top 10.
136 The C<size> parameter is only valid when you specify the C<sort>
137 option; it cannot be used in conjunction with C<buckets>.
138  
139 =item *
140  
141 C<sort> specifies how you want to sort the facets in the results:
142 C<bucket> or C<count>. Specify C<bucket> to sort alphabetically or
143 numerically by facet value (in ascending order). Specify C<count> to
144 sort by the facet counts computed for each facet value (in descending
145 order). To retrieve facet counts for particular values or ranges of
146 values, use the C<buckets> option instead of C<sort>.
147  
148 =back
149  
150 If no facet options are specified, facet counts are computed for all
151 field values, the facets are sorted by facet count, and the top 10
152 facets are returned in the results.
153  
154 To count particular buckets of values, use the C<buckets> option. For
155 example, the following request uses the C<buckets> option to calculate
156 and return facet counts by decade.
157  
158 C<{"year":{"buckets":["[1970,1979]","[1980,1989]","[1990,1999]","[2000,2009]","[2010,}"]}}>
159  
160 To sort facets by facet count, use the C<count> option. For example,
161 the following request sets the C<sort> option to C<count> to sort the
162 facet values by facet count, with the facet values that have the most
163 matching documents listed first. Setting the C<size> option to 3
164 returns only the top three facet values.
165  
166 C<{"year":{"sort":"count","size":3}}>
167  
168 To sort the facets by value, use the C<bucket> option. For example, the
169 following request sets the C<sort> option to C<bucket> to sort the
170 facet values numerically by year, with earliest year listed first.
171  
172 C<{"year":{"sort":"bucket"}}>
173  
174 For more information, see Getting and Using Facet Information
175 (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/faceting.html)
176 in the I<Amazon CloudSearch Developer Guide>.
177  
178  
179  
180 =head2 FilterQuery => Str
181  
182 Specifies a structured query that filters the results of a search
183 without affecting how the results are scored and sorted. You use
184 C<filterQuery> in conjunction with the C<query> parameter to filter the
185 documents that match the constraints specified in the C<query>
186 parameter. Specifying a filter controls only which matching documents
187 are included in the results, it has no effect on how they are scored
188 and sorted. The C<filterQuery> parameter supports the full structured
189 query syntax.
190  
191 For more information about using filters, see Filtering Matching
192 Documents
193 (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/filtering-results.html)
194 in the I<Amazon CloudSearch Developer Guide>.
195  
196  
197  
198 =head2 Highlight => Str
199  
200 Retrieves highlights for matches in the specified C<text> or
201 C<text-array> fields. Each specified field must be highlight enabled in
202 the domain configuration. The fields and options are specified in JSON
203 using the form
204 C<{"FIELD":{"OPTION":VALUE,"OPTION:"STRING"},"FIELD":{"OPTION":VALUE,"OPTION":"STRING"}}>.
205  
206 You can specify the following highlight options:
207  
208 =over
209  
210 =item * C<format>: specifies the format of the data in the text field:
211 C<text> or C<html>. When data is returned as HTML, all non-alphanumeric
212 characters are encoded. The default is C<html>.
213  
214 =item * C<max_phrases>: specifies the maximum number of occurrences of
215 the search term(s) you want to highlight. By default, the first
216 occurrence is highlighted.
217  
218 =item * C<pre_tag>: specifies the string to prepend to an occurrence of
219 a search term. The default for HTML highlights is C<E<lt>emE<gt>>. The
220 default for text highlights is C<*>.
221  
222 =item * C<post_tag>: specifies the string to append to an occurrence of
223 a search term. The default for HTML highlights is C<E<lt>/emE<gt>>. The
224 default for text highlights is C<*>.
225  
226 =back
227  
228 If no highlight options are specified for a field, the returned field
229 text is treated as HTML and the first match is highlighted with
230 emphasis tags: C<E<lt>emE<gt>search-termE<lt>/emE<gt>>.
231  
232 For example, the following request retrieves highlights for the
233 C<actors> and C<title> fields.
234  
235 C<{ "actors": {}, "title": {"format": "text","max_phrases":
236 2,"pre_tag": "B<","post_tag": ">"} }>
237  
238  
239  
240 =head2 Partial => Bool
241  
242 Enables partial results to be returned if one or more index partitions
243 are unavailable. When your search index is partitioned across multiple
244 search instances, by default Amazon CloudSearch only returns results if
245 every partition can be queried. This means that the failure of a single
246 search instance can result in 5xx (internal server) errors. When you
247 enable partial results, Amazon CloudSearch returns whatever results are
248 available and includes the percentage of documents searched in the
249 search results (percent-searched). This enables you to more gracefully
250 degrade your users' search experience. For example, rather than
251 displaying no results, you could display the partial results and a
252 message indicating that the results might be incomplete due to a
253 temporary system outage.
254  
255  
256  
257 =head2 B<REQUIRED> Query => Str
258  
259 Specifies the search criteria for the request. How you specify the
260 search criteria depends on the query parser used for the request and
261 the parser options specified in the C<queryOptions> parameter. By
262 default, the C<simple> query parser is used to process requests. To use
263 the C<structured>, C<lucene>, or C<dismax> query parser, you must also
264 specify the C<queryParser> parameter.
265  
266 For more information about specifying search criteria, see Searching
267 Your Data
268 (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching.html)
269 in the I<Amazon CloudSearch Developer Guide>.
270  
271  
272  
273 =head2 QueryOptions => Str
274  
275 Configures options for the query parser specified in the C<queryParser>
276 parameter. You specify the options in JSON using the following form
277 C<{"OPTION1":"VALUE1","OPTION2":VALUE2"..."OPTIONN":"VALUEN"}.>
278  
279 The options you can configure vary according to which parser you use:
280  
281 =over
282  
283 =item * C<defaultOperator>: The default operator used to combine
284 individual terms in the search string. For example: C<defaultOperator:
285 'or'>. For the C<dismax> parser, you specify a percentage that
286 represents the percentage of terms in the search string (rounded down)
287 that must match, rather than a default operator. A value of C<0%> is
288 the equivalent to OR, and a value of C<100%> is equivalent to AND. The
289 percentage must be specified as a value in the range 0-100 followed by
290 the percent (%) symbol. For example, C<defaultOperator: 50%>. Valid
291 values: C<and>, C<or>, a percentage in the range 0%-100% (C<dismax>).
292 Default: C<and> (C<simple>, C<structured>, C<lucene>) or C<100>
293 (C<dismax>). Valid for: C<simple>, C<structured>, C<lucene>, and
294 C<dismax>.
295  
296 =item * C<fields>: An array of the fields to search when no fields are
297 specified in a search. If no fields are specified in a search and this
298 option is not specified, all text and text-array fields are searched.
299 You can specify a weight for each field to control the relative
300 importance of each field when Amazon CloudSearch calculates relevance
301 scores. To specify a field weight, append a caret (C<^>) symbol and the
302 weight to the field name. For example, to boost the importance of the
303 C<title> field over the C<description> field you could specify:
304 C<"fields":["title^5","description"]>. Valid values: The name of any
305 configured field and an optional numeric value greater than zero.
306 Default: All C<text> and C<text-array> fields. Valid for: C<simple>,
307 C<structured>, C<lucene>, and C<dismax>.
308  
309 =item * C<operators>: An array of the operators or special characters
310 you want to disable for the simple query parser. If you disable the
311 C<and>, C<or>, or C<not> operators, the corresponding operators (C<+>,
312 C<|>, C<->) have no special meaning and are dropped from the search
313 string. Similarly, disabling C<prefix> disables the wildcard operator
314 (C<*>) and disabling C<phrase> disables the ability to search for
315 phrases by enclosing phrases in double quotes. Disabling precedence
316 disables the ability to control order of precedence using parentheses.
317 Disabling C<near> disables the ability to use the ~ operator to perform
318 a sloppy phrase search. Disabling the C<fuzzy> operator disables the
319 ability to use the ~ operator to perform a fuzzy search. C<escape>
320 disables the ability to use a backslash (C<\>) to escape special
321 characters within the search string. Disabling whitespace is an
322 advanced option that prevents the parser from tokenizing on whitespace,
323 which can be useful for Vietnamese. (It prevents Vietnamese words from
324 being split incorrectly.) For example, you could disable all operators
325 other than the phrase operator to support just simple term and phrase
326 queries: C<"operators":["and","not","or", "prefix"]>. Valid values:
327 C<and>, C<escape>, C<fuzzy>, C<near>, C<not>, C<or>, C<phrase>,
328 C<precedence>, C<prefix>, C<whitespace>. Default: All operators and
329 special characters are enabled. Valid for: C<simple>.
330  
331 =item * C<phraseFields>: An array of the C<text> or C<text-array>
332 fields you want to use for phrase searches. When the terms in the
333 search string appear in close proximity within a field, the field
334 scores higher. You can specify a weight for each field to boost that
335 score. The C<phraseSlop> option controls how much the matches can
336 deviate from the search string and still be boosted. To specify a field
337 weight, append a caret (C<^>) symbol and the weight to the field name.
338 For example, to boost phrase matches in the C<title> field over the
339 C<abstract> field, you could specify: C<"phraseFields":["title^3",
340 "plot"]> Valid values: The name of any C<text> or C<text-array> field
341 and an optional numeric value greater than zero. Default: No fields. If
342 you don't specify any fields with C<phraseFields>, proximity scoring is
343 disabled even if C<phraseSlop> is specified. Valid for: C<dismax>.
344  
345 =item * C<phraseSlop>: An integer value that specifies how much matches
346 can deviate from the search phrase and still be boosted according to
347 the weights specified in the C<phraseFields> option; for example,
348 C<phraseSlop: 2>. You must also specify C<phraseFields> to enable
349 proximity scoring. Valid values: positive integers. Default: 0. Valid
350 for: C<dismax>.
351  
352 =item * C<explicitPhraseSlop>: An integer value that specifies how much
353 a match can deviate from the search phrase when the phrase is enclosed
354 in double quotes in the search string. (Phrases that exceed this
355 proximity distance are not considered a match.) For example, to specify
356 a slop of three for dismax phrase queries, you would specify
357 C<"explicitPhraseSlop":3>. Valid values: positive integers. Default: 0.
358 Valid for: C<dismax>.
359  
360 =item * C<tieBreaker>: When a term in the search string is found in a
361 document's field, a score is calculated for that field based on how
362 common the word is in that field compared to other documents. If the
363 term occurs in multiple fields within a document, by default only the
364 highest scoring field contributes to the document's overall score. You
365 can specify a C<tieBreaker> value to enable the matches in
366 lower-scoring fields to contribute to the document's score. That way,
367 if two documents have the same max field score for a particular term,
368 the score for the document that has matches in more fields will be
369 higher. The formula for calculating the score with a tieBreaker is
370 C<(max field score) + (tieBreaker) * (sum of the scores for the rest of
371 the matching fields)>. Set C<tieBreaker> to 0 to disregard all but the
372 highest scoring field (pure max): C<"tieBreaker":0>. Set to 1 to sum
373 the scores from all fields (pure sum): C<"tieBreaker":1>. Valid values:
374 0.0 to 1.0. Default: 0.0. Valid for: C<dismax>.
375  
376 =back
377  
378  
379  
380  
381 =head2 QueryParser => Str
382  
383 Specifies which query parser to use to process the request. If
384 C<queryParser> is not specified, Amazon CloudSearch uses the C<simple>
385 query parser.
386  
387 Amazon CloudSearch supports four query parsers:
388  
389 =over
390  
391 =item * C<simple>: perform simple searches of C<text> and C<text-array>
392 fields. By default, the C<simple> query parser searches all C<text> and
393 C<text-array> fields. You can specify which fields to search by with
394 the C<queryOptions> parameter. If you prefix a search term with a plus
395 sign (+) documents must contain the term to be considered a match.
396 (This is the default, unless you configure the default operator with
397 the C<queryOptions> parameter.) You can use the C<-> (NOT), C<|> (OR),
398 and C<*> (wildcard) operators to exclude particular terms, find results
399 that match any of the specified terms, or search for a prefix. To
400 search for a phrase rather than individual terms, enclose the phrase in
401 double quotes. For more information, see Searching for Text
402 (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-text.html)
403 in the I<Amazon CloudSearch Developer Guide>.
404  
405 =item * C<structured>: perform advanced searches by combining multiple
406 expressions to define the search criteria. You can also search within
407 particular fields, search for values and ranges of values, and use
408 advanced options such as term boosting, C<matchall>, and C<near>. For
409 more information, see Constructing Compound Queries
410 (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-compound-queries.html)
411 in the I<Amazon CloudSearch Developer Guide>.
412  
413 =item * C<lucene>: search using the Apache Lucene query parser syntax.
414 For more information, see Apache Lucene Query Parser Syntax
415 (http://lucene.apache.org/core/4_6_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description).
416  
417 =item * C<dismax>: search using the simplified subset of the Apache
418 Lucene query parser syntax defined by the DisMax query parser. For more
419 information, see DisMax Query Parser Syntax
420 (http://wiki.apache.org/solr/DisMaxQParserPlugin#Query_Syntax).
421  
422 =back
423  
424  
425 Valid values are: C<"simple">, C<"structured">, C<"lucene">, C<"dismax">
426  
427 =head2 Return => Str
428  
429 Specifies the field and expression values to include in the response.
430 Multiple fields or expressions are specified as a comma-separated list.
431 By default, a search response includes all return enabled fields
432 (C<_all_fields>). To return only the document IDs for the matching
433 documents, specify C<_no_fields>. To retrieve the relevance score
434 calculated for each document, specify C<_score>.
435  
436  
437  
438 =head2 Size => Int
439  
440 Specifies the maximum number of search hits to include in the response.
441  
442  
443  
444 =head2 Sort => Str
445  
446 Specifies the fields or custom expressions to use to sort the search
447 results. Multiple fields or expressions are specified as a
448 comma-separated list. You must specify the sort direction (C<asc> or
449 C<desc>) for each field; for example, C<year desc,title asc>. To use a
450 field to sort results, the field must be sort-enabled in the domain
451 configuration. Array type fields cannot be used for sorting. If no
452 C<sort> parameter is specified, results are sorted by their default
453 relevance scores in descending order: C<_score desc>. You can also sort
454 by document ID (C<_id asc>) and version (C<_version desc>).
455  
456 For more information, see Sorting Results
457 (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/sorting-results.html)
458 in the I<Amazon CloudSearch Developer Guide>.
459  
460  
461  
462 =head2 Start => Int
463  
464 Specifies the offset of the first search hit you want to return. Note
465 that the result set is zero-based; the first result is at index 0. You
466 can specify either the C<start> or C<cursor> parameter in a request,
467 they are mutually exclusive.
468  
469 For more information, see Paginating Results
470 (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/paginating-results.html)
471 in the I<Amazon CloudSearch Developer Guide>.
472  
473  
474  
475 =head2 Stats => Str
476  
477 Specifies one or more fields for which to get statistics information.
478 Each specified field must be facet-enabled in the domain configuration.
479 The fields are specified in JSON using the form:
480  
481 C<{"FIELD-A":{},"FIELD-B":{}}>
482  
483 There are currently no options supported for statistics.
484  
485  
486  
487  
488 =head1 SEE ALSO
489  
490 This class forms part of L<Paws>, documenting arguments for method Search in L<Paws::CloudSearchDomain>
491  
492 =head1 BUGS and CONTRIBUTIONS
493  
494 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
495  
496 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
497  
498 =cut
499