blob: 2b3f161f5869bc7f02ca25599d70f1a9bc201c5e [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="cloudsearch_v1.html">Cloud Search API</a> . <a href="cloudsearch_v1.query.html">query</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="cloudsearch_v1.query.sources.html">sources()</a></code>
79</p>
80<p class="firstline">Returns the sources Resource.</p>
81
82<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070083 <code><a href="#search">search(body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070084<p class="firstline">The Cloud Search Query API provides the search method, which returns</p>
85<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070086 <code><a href="#suggest">suggest(body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070087<p class="firstline">Provides suggestions for autocompleting the query.</p>
88<h3>Method Details</h3>
89<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070090 <code class="details" id="search">search(body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070091 <pre>The Cloud Search Query API provides the search method, which returns
92the most relevant results from a user query. The results can come from
93G Suite Apps, such as Gmail or Google Drive, or they can come from data
94that you have indexed from a third party.
95
Dan O'Mearadd494642020-05-01 07:42:23 -070096**Note:** This API requires a standard end user account to execute.
Bu Sun Kim65020912020-05-20 12:08:20 -070097A service account can&#x27;t perform Query API requests directly; to use a
Dan O'Mearadd494642020-05-01 07:42:23 -070098service account to perform queries, set up [G Suite domain-wide delegation
99of
100authority](https://developers.google.com/cloud-search/docs/guides/delegation/).
101
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700102Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700103 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700104 The object takes the form of:
105
106{ # The search API request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700107 &quot;requestOptions&quot;: { # Shared request options for all RPC methods. # Request options, such as the search application and user timezone.
108 &quot;searchApplicationId&quot;: &quot;A String&quot;, # The ID generated when you create a search application using the
109 # [admin console](https://support.google.com/a/answer/9043922).
110 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;.
111 # For more information, see
112 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
113 # For translations.
114 #
115 # Set this field using the language set in browser or for the page. In the
116 # event that the user&#x27;s language preference is known, set this field to the
117 # known user language.
118 #
119 # When specified, the documents in search results are biased towards the
120 # specified language.
121 #
122 # The suggest API does not use this parameter. Instead, suggest autocompletes
123 # only based on characters in the query.
124 &quot;timeZone&quot;: &quot;A String&quot;, # Current user&#x27;s time zone id, such as &quot;America/Los_Angeles&quot; or
125 # &quot;Australia/Sydney&quot;. These IDs are defined by
126 # [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/)
127 # project, and currently available in the file
128 # [timezone.xml](http://unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml).
129 # This field is used to correctly interpret date and time queries.
130 # If this field is not specified, the default time zone (UTC) is used.
131 &quot;debugOptions&quot;: { # Shared request debug options for all cloudsearch RPC methods. # Debug options of the request
132 &quot;enableDebugging&quot;: True or False, # If you are asked by Google to help with debugging, set this field.
133 # Otherwise, ignore this field.
134 },
135 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700136 &quot;dataSourceRestrictions&quot;: [ # The sources to use for querying. If not specified, all data sources
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700137 # from the current search application are used.
138 { # Restriction on Datasource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700139 &quot;filterOptions&quot;: [ # Filter options restricting the results. If multiple filters
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700140 # are present, they are grouped by object type before joining.
141 # Filters with the same object type are joined conjunctively, then
142 # the resulting expressions are joined disjunctively.
143 #
144 # The maximum number of elements is 20.
145 #
146 # NOTE: Suggest API supports only few filters at the moment:
Bu Sun Kim65020912020-05-20 12:08:20 -0700147 # &quot;objecttype&quot;, &quot;type&quot; and &quot;mimetype&quot;.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700148 # For now, schema specific filters cannot be used to filter suggestions.
149 { # Filter options to be applied on query.
Bu Sun Kim65020912020-05-20 12:08:20 -0700150 &quot;filter&quot;: { # A generic way of expressing filters in a query, which supports two # Generic filter to restrict the search, such as `lang:en`, `site:xyz`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700151 # approaches: &lt;br/&gt;&lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700152 # **1. Setting a ValueFilter.** The name must match an operator_name defined in
153 # the schema for your data source.
Dan O'Mearadd494642020-05-01 07:42:23 -0700154 # &lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700155 # **2. Setting a CompositeFilter.** The filters are evaluated
156 # using the logical operator. The top-level operators can only be either an AND
157 # or a NOT. AND can appear only at the top-most level. OR can appear only under
158 # a top-level AND.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700159 &quot;compositeFilter&quot;: {
160 &quot;logicOperator&quot;: &quot;A String&quot;, # The logic operator of the sub filter.
161 &quot;subFilters&quot;: [ # Sub filters.
162 # Object with schema name: Filter
163 ],
164 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700165 &quot;valueFilter&quot;: {
166 &quot;operatorName&quot;: &quot;A String&quot;, # The `operator_name` applied to the query, such as *price_greater_than*.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700167 # The filter can work against both types of filters defined in the schema
168 # for your data source:
Dan O'Mearadd494642020-05-01 07:42:23 -0700169 # &lt;br/&gt;&lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700170 # 1. `operator_name`, where the query filters results by the property
171 # that matches the value.
Dan O'Mearadd494642020-05-01 07:42:23 -0700172 # &lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700173 # 2. `greater_than_operator_name` or `less_than_operator_name` in your
174 # schema. The query filters the results for the property values that are
175 # greater than or less than the supplied value in the query.
Bu Sun Kim65020912020-05-20 12:08:20 -0700176 &quot;value&quot;: { # Definition of a single value with generic type. # The value to be compared with.
177 &quot;integerValue&quot;: &quot;A String&quot;,
178 &quot;stringValue&quot;: &quot;A String&quot;,
179 &quot;dateValue&quot;: { # Represents a whole calendar date, for example a date of birth. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the [Proleptic Gregorian Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). The date must be a valid calendar date between the year 1 and 9999.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700180 &quot;month&quot;: 42, # Month of date. Must be from 1 to 12.
Bu Sun Kim65020912020-05-20 12:08:20 -0700181 &quot;day&quot;: 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
182 &quot;year&quot;: 42, # Year of date. Must be from 1 to 9999.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700183 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700184 &quot;doubleValue&quot;: 3.14,
185 &quot;timestampValue&quot;: &quot;A String&quot;,
186 &quot;booleanValue&quot;: True or False,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700187 },
188 },
189 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700190 &quot;objectType&quot;: &quot;A String&quot;, # If object_type is set, only objects of that type are returned. This should
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700191 # correspond to the name of the object that was registered within the
192 # definition of schema. The maximum length is 256 characters.
193 },
194 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700195 &quot;source&quot;: { # Defines sources for the suggest/search APIs. # The source of restriction.
Bu Sun Kim65020912020-05-20 12:08:20 -0700196 &quot;name&quot;: &quot;A String&quot;, # Source name for content indexed by the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700197 # Indexing API.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700198 &quot;predefinedSource&quot;: &quot;A String&quot;, # Predefined content source for Google Apps.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700199 },
200 },
201 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700202 &quot;sortOptions&quot;: { # The options for sorting the search results
203 &quot;sortOrder&quot;: &quot;A String&quot;, # Ascending is the default sort order
204 &quot;operatorName&quot;: &quot;A String&quot;, # Name of the operator corresponding to the field to sort on.
205 # The corresponding property must be marked as
206 # sortable.
207 },
208 &quot;facetOptions&quot;: [
209 { # Specifies operators to return facet results for. There will be one
210 # FacetResult for every source_name/object_type/operator_name combination.
211 &quot;numFacetBuckets&quot;: 42, # Maximum number of facet buckets that should be returned for this facet.
212 # Defaults to 10.
213 # Maximum value is 100.
214 &quot;sourceName&quot;: &quot;A String&quot;, # Source name to facet on. Format: datasources/{source_id}
215 # If empty, all data sources will be used.
216 &quot;operatorName&quot;: &quot;A String&quot;, # Name of the operator chosen for faceting. @see
217 # cloudsearch.SchemaPropertyOptions
218 &quot;objectType&quot;: &quot;A String&quot;, # If object_type is set, only those objects of that type will be used to
219 # compute facets. If empty, then all objects will be used to compute facets.
220 },
221 ],
222 &quot;pageSize&quot;: 42, # Maximum number of search results to return in one page.
223 # Valid values are between 1 and 100, inclusive.
224 # Default value is 10.
225 &quot;query&quot;: &quot;A String&quot;, # The raw query string.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700226 # See supported search operators in the [Cloud search
227 # Cheat
228 # Sheet](https://gsuite.google.com/learning-center/products/cloudsearch/cheat-sheet/)
Bu Sun Kim65020912020-05-20 12:08:20 -0700229 &quot;start&quot;: 42, # Starting index of the results.
230 &quot;queryInterpretationOptions&quot;: { # Options to interpret user query. # Options to interpret the user query.
231 &quot;enableVerbatimMode&quot;: True or False, # Enable this flag to turn off all internal optimizations like natural
232 # language (NL) interpretation of queries, supplemental result retrieval,
233 # and usage of synonyms including custom ones.
234 # Nl interpretation will be disabled if either one of the two flags is true.
235 &quot;disableNlInterpretation&quot;: True or False, # Flag to disable natural language (NL) interpretation of queries. Default is
236 # false, Set to true to disable natural language interpretation. NL
237 # interpretation only applies to predefined datasources.
238 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700239 }
240
241 x__xgafv: string, V1 error format.
242 Allowed values
243 1 - v1 error format
244 2 - v2 error format
245
246Returns:
247 An object of the form:
248
249 { # The search API response.
250 &quot;results&quot;: [ # Results from a search query.
251 { # Results containing indexed information for a document.
252 &quot;debugInfo&quot;: { # Debugging information about the result. # Debugging information about this search result.
253 &quot;formattedDebugInfo&quot;: &quot;A String&quot;, # General debug info formatted for display.
254 },
255 &quot;clusteredResults&quot;: [ # If source is clustered, provide list of clustered results. There will only
256 # be one level of clustered results. If current source is not enabled for
257 # clustering, this field will be empty.
258 # Object with schema name: SearchResult
259 ],
260 &quot;url&quot;: &quot;A String&quot;, # The URL of the search result. The URL contains a Google redirect to the
261 # actual item. This URL is signed and shouldn&#x27;t be changed.
262 &quot;metadata&quot;: { # Metadata of a matched search result. # Metadata of the search result.
263 &quot;displayOptions&quot;: { # Options that specify how to display a structured data search result.
264 &quot;objectTypeLabel&quot;: &quot;A String&quot;, # The display label for the object.
265 &quot;metalines&quot;: [ # The metalines content to be displayed with the result.
266 { # The collection of fields that make up a displayed line
267 &quot;fields&quot;: [
268 { # Display Fields for Search Results
269 &quot;operatorName&quot;: &quot;A String&quot;, # The operator name of the property.
270 &quot;label&quot;: &quot;A String&quot;, # The display label for the property.
271 &quot;property&quot;: { # A typed name-value pair for structured data. The type of the value should # The name value pair for the property.
272 # be the same as the registered type for the `name` property in the object
273 # definition of `objectType`.
274 &quot;integerValues&quot;: { # List of integer values.
275 &quot;values&quot;: [
276 &quot;A String&quot;,
277 ],
278 },
279 &quot;name&quot;: &quot;A String&quot;, # The name of the property. This name should correspond to the name of the
280 # property that was registered for object definition in the schema.
281 # The maximum allowable length for this property is 256 characters.
282 &quot;doubleValues&quot;: { # List of double values.
283 &quot;values&quot;: [
284 3.14,
285 ],
286 },
287 &quot;booleanValue&quot;: True or False,
288 &quot;htmlValues&quot;: { # List of html values.
289 &quot;values&quot;: [ # The maximum allowable length for html values is 2048 characters.
290 &quot;A String&quot;,
291 ],
292 },
293 &quot;textValues&quot;: { # List of text values.
294 &quot;values&quot;: [ # The maximum allowable length for text values is 2048 characters.
295 &quot;A String&quot;,
296 ],
297 },
298 &quot;timestampValues&quot;: { # List of timestamp values.
299 &quot;values&quot;: [
300 &quot;A String&quot;,
301 ],
302 },
303 &quot;objectValues&quot;: { # List of object values.
304 &quot;values&quot;: [
305 # Object with schema name: StructuredDataObject
306 ],
307 },
308 &quot;dateValues&quot;: { # List of date values.
309 &quot;values&quot;: [
310 { # Represents a whole calendar date, for example a date of birth. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the [Proleptic Gregorian Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). The date must be a valid calendar date between the year 1 and 9999.
311 &quot;month&quot;: 42, # Month of date. Must be from 1 to 12.
312 &quot;day&quot;: 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
313 &quot;year&quot;: 42, # Year of date. Must be from 1 to 9999.
314 },
315 ],
316 },
317 &quot;enumValues&quot;: { # List of enum values.
318 &quot;values&quot;: [ # The maximum allowable length for string values is 32 characters.
319 &quot;A String&quot;,
320 ],
321 },
322 },
323 },
324 ],
325 },
326 ],
327 },
328 &quot;source&quot;: { # Defines sources for the suggest/search APIs. # The named source for the result, such as Gmail.
329 &quot;name&quot;: &quot;A String&quot;, # Source name for content indexed by the
330 # Indexing API.
331 &quot;predefinedSource&quot;: &quot;A String&quot;, # Predefined content source for Google Apps.
332 },
333 &quot;createTime&quot;: &quot;A String&quot;, # The creation time for this document or object in the search result.
334 &quot;updateTime&quot;: &quot;A String&quot;, # The last modified date for the object in the search result. If not
335 # set in the item, the value returned here is empty. When
336 # `updateTime` is used for calculating freshness and is not set, this
337 # value defaults to 2 years from the current time.
338 &quot;fields&quot;: [ # Indexed fields in structured data, returned as a generic named property.
339 { # A typed name-value pair for structured data. The type of the value should
340 # be the same as the registered type for the `name` property in the object
341 # definition of `objectType`.
342 &quot;integerValues&quot;: { # List of integer values.
343 &quot;values&quot;: [
344 &quot;A String&quot;,
345 ],
346 },
347 &quot;name&quot;: &quot;A String&quot;, # The name of the property. This name should correspond to the name of the
348 # property that was registered for object definition in the schema.
349 # The maximum allowable length for this property is 256 characters.
350 &quot;doubleValues&quot;: { # List of double values.
351 &quot;values&quot;: [
352 3.14,
353 ],
354 },
355 &quot;booleanValue&quot;: True or False,
356 &quot;htmlValues&quot;: { # List of html values.
357 &quot;values&quot;: [ # The maximum allowable length for html values is 2048 characters.
358 &quot;A String&quot;,
359 ],
360 },
361 &quot;textValues&quot;: { # List of text values.
362 &quot;values&quot;: [ # The maximum allowable length for text values is 2048 characters.
363 &quot;A String&quot;,
364 ],
365 },
366 &quot;timestampValues&quot;: { # List of timestamp values.
367 &quot;values&quot;: [
368 &quot;A String&quot;,
369 ],
370 },
371 &quot;objectValues&quot;: { # List of object values.
372 &quot;values&quot;: [
373 # Object with schema name: StructuredDataObject
374 ],
375 },
376 &quot;dateValues&quot;: { # List of date values.
377 &quot;values&quot;: [
378 { # Represents a whole calendar date, for example a date of birth. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the [Proleptic Gregorian Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). The date must be a valid calendar date between the year 1 and 9999.
379 &quot;month&quot;: 42, # Month of date. Must be from 1 to 12.
380 &quot;day&quot;: 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
381 &quot;year&quot;: 42, # Year of date. Must be from 1 to 9999.
382 },
383 ],
384 },
385 &quot;enumValues&quot;: { # List of enum values.
386 &quot;values&quot;: [ # The maximum allowable length for string values is 32 characters.
387 &quot;A String&quot;,
388 ],
389 },
390 },
391 ],
392 &quot;owner&quot;: { # Object to represent a person. # Owner (usually creator) of the document or object of the search result.
393 &quot;obfuscatedId&quot;: &quot;A String&quot;, # Obfuscated ID of a person.
394 &quot;photos&quot;: [ # A person&#x27;s read-only photo. A picture shown next to the person&#x27;s name to
395 # help others recognize the person in search results.
396 { # A person&#x27;s photo.
397 &quot;url&quot;: &quot;A String&quot;, # The URL of the photo.
398 },
399 ],
400 &quot;emailAddresses&quot;: [ # The person&#x27;s email addresses
401 { # A person&#x27;s email address.
402 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address.
403 },
404 ],
405 &quot;personNames&quot;: [ # The person&#x27;s name
406 { # A person&#x27;s name.
407 &quot;displayName&quot;: &quot;A String&quot;, # The read-only display name formatted according to the locale specified by
408 # the viewer&#x27;s account or the &lt;code&gt;Accept-Language&lt;/code&gt; HTTP header.
409 },
410 ],
411 &quot;name&quot;: &quot;A String&quot;, # The resource name of the person to provide information about.
412 # See &lt;a href=&quot;https://developers.google.com/people/api/rest/v1/people/get&quot;&gt;
413 # People.get&lt;/a&gt; from Google People API.
414 },
415 &quot;mimeType&quot;: &quot;A String&quot;, # Mime type of the search result.
416 &quot;objectType&quot;: &quot;A String&quot;, # Object type of the search result.
417 },
418 &quot;snippet&quot;: { # Snippet of the search result, which summarizes the content of the resulting # The concatenation of all snippets (summaries) available for this result.
419 # page.
420 &quot;snippet&quot;: &quot;A String&quot;, # The snippet of the document.
421 # The snippet of the document. May contain escaped HTML character that
422 # should be unescaped prior to rendering.
423 &quot;matchRanges&quot;: [ # The matched ranges in the snippet.
424 { # Matched range of a snippet [start, end).
425 &quot;end&quot;: 42, # End of the match in the snippet.
426 &quot;start&quot;: 42, # Starting position of the match in the snippet.
427 },
428 ],
429 },
430 &quot;title&quot;: &quot;A String&quot;, # Title of the search result.
431 },
432 ],
433 &quot;debugInfo&quot;: { # Debugging information about the response. # Debugging information about the response.
434 &quot;formattedDebugInfo&quot;: &quot;A String&quot;, # General debug info formatted for display.
435 },
436 &quot;resultCountEstimate&quot;: &quot;A String&quot;, # The estimated result count for this query.
437 &quot;resultCounts&quot;: { # Result count information # Expanded result count information.
438 &quot;sourceResultCounts&quot;: [ # Result count information for each source with results.
439 { # Per source result count information.
440 &quot;resultCountEstimate&quot;: &quot;A String&quot;, # The estimated result count for this source.
441 &quot;hasMoreResults&quot;: True or False, # Whether there are more search results for this source.
442 &quot;source&quot;: { # Defines sources for the suggest/search APIs. # The source the result count information is associated with.
443 &quot;name&quot;: &quot;A String&quot;, # Source name for content indexed by the
444 # Indexing API.
445 &quot;predefinedSource&quot;: &quot;A String&quot;, # Predefined content source for Google Apps.
446 },
447 &quot;resultCountExact&quot;: &quot;A String&quot;, # The exact result count for this source.
448 },
449 ],
450 },
451 &quot;facetResults&quot;: [ # Repeated facet results.
452 { # Source specific facet response
453 &quot;buckets&quot;: [ # FacetBuckets for values in response containing at least a single result.
454 { # A bucket in a facet is the basic unit of operation. A bucket can comprise
455 # either a single value OR a contiguous range of values, depending on the
456 # type of the field bucketed.
457 # FacetBucket is currently used only for returning the response object.
458 &quot;count&quot;: 42, # Number of results that match the bucket value. Counts are only returned
459 # for searches when count accuracy is ensured. Can be empty.
460 &quot;percentage&quot;: 42, # Percent of results that match the bucket value. The returned value is
461 # between (0-100], and is rounded down to an integer if fractional. If the
462 # value is not explicitly returned, it represents a percentage value that
463 # rounds to 0. Percentages are returned for all searches, but are an
464 # estimate. Because percentages are always returned, you should render
465 # percentages instead of counts.
466 &quot;value&quot;: { # Definition of a single value with generic type.
467 &quot;integerValue&quot;: &quot;A String&quot;,
468 &quot;stringValue&quot;: &quot;A String&quot;,
469 &quot;dateValue&quot;: { # Represents a whole calendar date, for example a date of birth. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the [Proleptic Gregorian Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). The date must be a valid calendar date between the year 1 and 9999.
470 &quot;month&quot;: 42, # Month of date. Must be from 1 to 12.
471 &quot;day&quot;: 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
472 &quot;year&quot;: 42, # Year of date. Must be from 1 to 9999.
473 },
474 &quot;doubleValue&quot;: 3.14,
475 &quot;timestampValue&quot;: &quot;A String&quot;,
476 &quot;booleanValue&quot;: True or False,
477 },
478 },
479 ],
480 &quot;sourceName&quot;: &quot;A String&quot;, # Source name for which facet results are returned. Will not be empty.
481 &quot;operatorName&quot;: &quot;A String&quot;, # Name of the operator chosen for faceting. @see
482 # cloudsearch.SchemaPropertyOptions
483 &quot;objectType&quot;: &quot;A String&quot;, # Object type for which facet results are returned. Can be empty.
484 },
485 ],
486 &quot;structuredResults&quot;: [ # Structured results for the user query. These results are not counted
487 # against the page_size.
488 { # Structured results that are returned as part of search request.
489 &quot;person&quot;: { # Object to represent a person. # Representation of a person
490 &quot;obfuscatedId&quot;: &quot;A String&quot;, # Obfuscated ID of a person.
491 &quot;photos&quot;: [ # A person&#x27;s read-only photo. A picture shown next to the person&#x27;s name to
492 # help others recognize the person in search results.
493 { # A person&#x27;s photo.
494 &quot;url&quot;: &quot;A String&quot;, # The URL of the photo.
495 },
496 ],
497 &quot;emailAddresses&quot;: [ # The person&#x27;s email addresses
498 { # A person&#x27;s email address.
499 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address.
500 },
501 ],
502 &quot;personNames&quot;: [ # The person&#x27;s name
503 { # A person&#x27;s name.
504 &quot;displayName&quot;: &quot;A String&quot;, # The read-only display name formatted according to the locale specified by
505 # the viewer&#x27;s account or the &lt;code&gt;Accept-Language&lt;/code&gt; HTTP header.
506 },
507 ],
508 &quot;name&quot;: &quot;A String&quot;, # The resource name of the person to provide information about.
509 # See &lt;a href=&quot;https://developers.google.com/people/api/rest/v1/people/get&quot;&gt;
510 # People.get&lt;/a&gt; from Google People API.
511 },
512 },
513 ],
514 &quot;spellResults&quot;: [ # Suggested spelling for the query.
515 {
516 &quot;suggestedQuery&quot;: &quot;A String&quot;, # The suggested spelling of the query.
517 },
518 ],
519 &quot;resultCountExact&quot;: &quot;A String&quot;, # The exact result count for this query.
520 &quot;errorInfo&quot;: { # Error information about the response. # Error information about the response.
521 &quot;errorMessages&quot;: [
522 { # Error message per source response.
523 &quot;errorMessage&quot;: &quot;A String&quot;,
524 &quot;source&quot;: { # Defines sources for the suggest/search APIs.
525 &quot;name&quot;: &quot;A String&quot;, # Source name for content indexed by the
526 # Indexing API.
527 &quot;predefinedSource&quot;: &quot;A String&quot;, # Predefined content source for Google Apps.
528 },
529 },
530 ],
531 },
532 &quot;hasMoreResults&quot;: True or False, # Whether there are more search results matching the query.
533 &quot;queryInterpretation&quot;: { # Query interpretation result for user query. Empty if query interpretation
534 # is disabled.
535 &quot;interpretationType&quot;: &quot;A String&quot;,
536 &quot;reason&quot;: &quot;A String&quot;, # The reason for interpretation of the query. This field will not be
537 # UNSPECIFIED if the interpretation type is not NONE.
538 &quot;interpretedQuery&quot;: &quot;A String&quot;, # The interpretation of the query used in search. For example, queries with
539 # natural language intent like &quot;email from john&quot; will be interpreted as
540 # &quot;from:john source:mail&quot;. This field will not be filled when the reason is
541 # NOT_ENOUGH_RESULTS_FOUND_FOR_USER_QUERY.
542 },
543 }</pre>
544</div>
545
546<div class="method">
547 <code class="details" id="suggest">suggest(body=None, x__xgafv=None)</code>
548 <pre>Provides suggestions for autocompleting the query.
549
550**Note:** This API requires a standard end user account to execute.
551A service account can&#x27;t perform Query API requests directly; to use a
552service account to perform queries, set up [G Suite domain-wide delegation
553of
554authority](https://developers.google.com/cloud-search/docs/guides/delegation/).
555
556Args:
557 body: object, The request body.
558 The object takes the form of:
559
560{ # Request of suggest API.
561 &quot;query&quot;: &quot;A String&quot;, # Partial query for which autocomplete suggestions will be shown.
562 # For example, if the query is &quot;sea&quot;, then the server might return
563 # &quot;season&quot;, &quot;search&quot;, &quot;seagull&quot; and so on.
Bu Sun Kim65020912020-05-20 12:08:20 -0700564 &quot;requestOptions&quot;: { # Shared request options for all RPC methods. # Request options, such as the search application and user timezone.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700565 &quot;searchApplicationId&quot;: &quot;A String&quot;, # The ID generated when you create a search application using the
566 # [admin console](https://support.google.com/a/answer/9043922).
Bu Sun Kim65020912020-05-20 12:08:20 -0700567 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;.
568 # For more information, see
569 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
570 # For translations.
571 #
572 # Set this field using the language set in browser or for the page. In the
573 # event that the user&#x27;s language preference is known, set this field to the
574 # known user language.
575 #
576 # When specified, the documents in search results are biased towards the
577 # specified language.
578 #
579 # The suggest API does not use this parameter. Instead, suggest autocompletes
580 # only based on characters in the query.
581 &quot;timeZone&quot;: &quot;A String&quot;, # Current user&#x27;s time zone id, such as &quot;America/Los_Angeles&quot; or
582 # &quot;Australia/Sydney&quot;. These IDs are defined by
583 # [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/)
584 # project, and currently available in the file
585 # [timezone.xml](http://unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml).
586 # This field is used to correctly interpret date and time queries.
587 # If this field is not specified, the default time zone (UTC) is used.
588 &quot;debugOptions&quot;: { # Shared request debug options for all cloudsearch RPC methods. # Debug options of the request
589 &quot;enableDebugging&quot;: True or False, # If you are asked by Google to help with debugging, set this field.
590 # Otherwise, ignore this field.
591 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700592 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700593 &quot;dataSourceRestrictions&quot;: [ # The sources to use for suggestions. If not specified, the data sources
Dan O'Mearadd494642020-05-01 07:42:23 -0700594 # are taken from the current search application.
595 #
596 # NOTE: Suggestions are supported only for third party data sources and
597 # people (i.e. PredefinedSource.PERSON).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700598 { # Restriction on Datasource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700599 &quot;filterOptions&quot;: [ # Filter options restricting the results. If multiple filters
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700600 # are present, they are grouped by object type before joining.
601 # Filters with the same object type are joined conjunctively, then
602 # the resulting expressions are joined disjunctively.
603 #
604 # The maximum number of elements is 20.
605 #
606 # NOTE: Suggest API supports only few filters at the moment:
Bu Sun Kim65020912020-05-20 12:08:20 -0700607 # &quot;objecttype&quot;, &quot;type&quot; and &quot;mimetype&quot;.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700608 # For now, schema specific filters cannot be used to filter suggestions.
609 { # Filter options to be applied on query.
Bu Sun Kim65020912020-05-20 12:08:20 -0700610 &quot;filter&quot;: { # A generic way of expressing filters in a query, which supports two # Generic filter to restrict the search, such as `lang:en`, `site:xyz`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700611 # approaches: &lt;br/&gt;&lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700612 # **1. Setting a ValueFilter.** The name must match an operator_name defined in
613 # the schema for your data source.
Dan O'Mearadd494642020-05-01 07:42:23 -0700614 # &lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700615 # **2. Setting a CompositeFilter.** The filters are evaluated
616 # using the logical operator. The top-level operators can only be either an AND
617 # or a NOT. AND can appear only at the top-most level. OR can appear only under
618 # a top-level AND.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700619 &quot;compositeFilter&quot;: {
620 &quot;logicOperator&quot;: &quot;A String&quot;, # The logic operator of the sub filter.
621 &quot;subFilters&quot;: [ # Sub filters.
622 # Object with schema name: Filter
623 ],
624 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700625 &quot;valueFilter&quot;: {
626 &quot;operatorName&quot;: &quot;A String&quot;, # The `operator_name` applied to the query, such as *price_greater_than*.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700627 # The filter can work against both types of filters defined in the schema
628 # for your data source:
Dan O'Mearadd494642020-05-01 07:42:23 -0700629 # &lt;br/&gt;&lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700630 # 1. `operator_name`, where the query filters results by the property
631 # that matches the value.
Dan O'Mearadd494642020-05-01 07:42:23 -0700632 # &lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700633 # 2. `greater_than_operator_name` or `less_than_operator_name` in your
634 # schema. The query filters the results for the property values that are
635 # greater than or less than the supplied value in the query.
Bu Sun Kim65020912020-05-20 12:08:20 -0700636 &quot;value&quot;: { # Definition of a single value with generic type. # The value to be compared with.
637 &quot;integerValue&quot;: &quot;A String&quot;,
638 &quot;stringValue&quot;: &quot;A String&quot;,
639 &quot;dateValue&quot;: { # Represents a whole calendar date, for example a date of birth. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the [Proleptic Gregorian Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). The date must be a valid calendar date between the year 1 and 9999.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700640 &quot;month&quot;: 42, # Month of date. Must be from 1 to 12.
Bu Sun Kim65020912020-05-20 12:08:20 -0700641 &quot;day&quot;: 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
642 &quot;year&quot;: 42, # Year of date. Must be from 1 to 9999.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700643 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700644 &quot;doubleValue&quot;: 3.14,
645 &quot;timestampValue&quot;: &quot;A String&quot;,
646 &quot;booleanValue&quot;: True or False,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700647 },
648 },
649 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700650 &quot;objectType&quot;: &quot;A String&quot;, # If object_type is set, only objects of that type are returned. This should
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700651 # correspond to the name of the object that was registered within the
652 # definition of schema. The maximum length is 256 characters.
653 },
654 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700655 &quot;source&quot;: { # Defines sources for the suggest/search APIs. # The source of restriction.
Bu Sun Kim65020912020-05-20 12:08:20 -0700656 &quot;name&quot;: &quot;A String&quot;, # Source name for content indexed by the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700657 # Indexing API.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700658 &quot;predefinedSource&quot;: &quot;A String&quot;, # Predefined content source for Google Apps.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700659 },
660 },
661 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700662 }
663
664 x__xgafv: string, V1 error format.
665 Allowed values
666 1 - v1 error format
667 2 - v2 error format
668
669Returns:
670 An object of the form:
671
672 { # Response of the suggest API.
Bu Sun Kim65020912020-05-20 12:08:20 -0700673 &quot;suggestResults&quot;: [ # List of suggestions.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700674 { # One suggestion result.
Bu Sun Kim65020912020-05-20 12:08:20 -0700675 &quot;querySuggestion&quot;: { # This field does not contain anything as of now and is just used as an # This field will be present if the suggested query is a word/phrase
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700676 # completion.
677 # indicator that the suggest result was a phrase completion.
678 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700679 &quot;source&quot;: { # Defines sources for the suggest/search APIs. # The source of the suggestion.
Bu Sun Kim65020912020-05-20 12:08:20 -0700680 &quot;name&quot;: &quot;A String&quot;, # Source name for content indexed by the
681 # Indexing API.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700682 &quot;predefinedSource&quot;: &quot;A String&quot;, # Predefined content source for Google Apps.
Bu Sun Kim65020912020-05-20 12:08:20 -0700683 },
684 &quot;suggestedQuery&quot;: &quot;A String&quot;, # The suggested query that will be used for search, when the user
685 # clicks on the suggestion
686 &quot;peopleSuggestion&quot;: { # This field contains information about the person being suggested. # This is present when the suggestion indicates a person. It
687 # contains more information about the person - like their email ID,
688 # name etc.
689 &quot;person&quot;: { # Object to represent a person. # Suggested person. All fields of the person object might not be populated.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700690 &quot;obfuscatedId&quot;: &quot;A String&quot;, # Obfuscated ID of a person.
691 &quot;photos&quot;: [ # A person&#x27;s read-only photo. A picture shown next to the person&#x27;s name to
692 # help others recognize the person in search results.
693 { # A person&#x27;s photo.
694 &quot;url&quot;: &quot;A String&quot;, # The URL of the photo.
695 },
696 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700697 &quot;emailAddresses&quot;: [ # The person&#x27;s email addresses
698 { # A person&#x27;s email address.
699 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address.
700 },
701 ],
702 &quot;personNames&quot;: [ # The person&#x27;s name
703 { # A person&#x27;s name.
704 &quot;displayName&quot;: &quot;A String&quot;, # The read-only display name formatted according to the locale specified by
705 # the viewer&#x27;s account or the &lt;code&gt;Accept-Language&lt;/code&gt; HTTP header.
706 },
707 ],
708 &quot;name&quot;: &quot;A String&quot;, # The resource name of the person to provide information about.
709 # See &lt;a href=&quot;https://developers.google.com/people/api/rest/v1/people/get&quot;&gt;
710 # People.get&lt;/a&gt; from Google People API.
Bu Sun Kim65020912020-05-20 12:08:20 -0700711 },
712 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700713 },
714 ],
715 }</pre>
716</div>
717
718</body></html>