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