blob: e2f85c07313cfdc7a05dfb14910b20308b5415e7 [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 Kimd059ad82020-07-22 17:02:09 -0700107 &quot;sortOptions&quot;: { # The options for sorting the search results
108 &quot;operatorName&quot;: &quot;A String&quot;, # Name of the operator corresponding to the field to sort on.
109 # The corresponding property must be marked as
110 # sortable.
111 &quot;sortOrder&quot;: &quot;A String&quot;, # Ascending is the default sort order
112 },
113 &quot;facetOptions&quot;: [
114 { # Specifies operators to return facet results for. There will be one
115 # FacetResult for every source_name/object_type/operator_name combination.
116 &quot;numFacetBuckets&quot;: 42, # Maximum number of facet buckets that should be returned for this facet.
117 # Defaults to 10.
118 # Maximum value is 100.
119 &quot;operatorName&quot;: &quot;A String&quot;, # Name of the operator chosen for faceting. @see
120 # cloudsearch.SchemaPropertyOptions
121 &quot;objectType&quot;: &quot;A String&quot;, # If object_type is set, only those objects of that type will be used to
122 # compute facets. If empty, then all objects will be used to compute facets.
123 &quot;sourceName&quot;: &quot;A String&quot;, # Source name to facet on. Format: datasources/{source_id}
124 # If empty, all data sources will be used.
125 },
126 ],
127 &quot;dataSourceRestrictions&quot;: [ # The sources to use for querying. If not specified, all data sources
128 # from the current search application are used.
129 { # Restriction on Datasource.
130 &quot;source&quot;: { # Defines sources for the suggest/search APIs. # The source of restriction.
131 &quot;name&quot;: &quot;A String&quot;, # Source name for content indexed by the
132 # Indexing API.
133 &quot;predefinedSource&quot;: &quot;A String&quot;, # Predefined content source for Google Apps.
134 },
135 &quot;filterOptions&quot;: [ # Filter options restricting the results. If multiple filters
136 # are present, they are grouped by object type before joining.
137 # Filters with the same object type are joined conjunctively, then
138 # the resulting expressions are joined disjunctively.
139 #
140 # The maximum number of elements is 20.
141 #
142 # NOTE: Suggest API supports only few filters at the moment:
143 # &quot;objecttype&quot;, &quot;type&quot; and &quot;mimetype&quot;.
144 # For now, schema specific filters cannot be used to filter suggestions.
145 { # Filter options to be applied on query.
146 &quot;objectType&quot;: &quot;A String&quot;, # If object_type is set, only objects of that type are returned. This should
147 # correspond to the name of the object that was registered within the
148 # definition of schema. The maximum length is 256 characters.
149 &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`.
150 # approaches: &lt;br/&gt;&lt;br/&gt;
151 # **1. Setting a ValueFilter.** The name must match an operator_name defined in
152 # the schema for your data source.
153 # &lt;br/&gt;
154 # **2. Setting a CompositeFilter.** The filters are evaluated
155 # using the logical operator. The top-level operators can only be either an AND
156 # or a NOT. AND can appear only at the top-most level. OR can appear only under
157 # a top-level AND.
158 &quot;compositeFilter&quot;: {
159 &quot;subFilters&quot;: [ # Sub filters.
160 # Object with schema name: Filter
161 ],
162 &quot;logicOperator&quot;: &quot;A String&quot;, # The logic operator of the sub filter.
163 },
164 &quot;valueFilter&quot;: {
165 &quot;value&quot;: { # Definition of a single value with generic type. # The value to be compared with.
166 &quot;integerValue&quot;: &quot;A String&quot;,
167 &quot;stringValue&quot;: &quot;A String&quot;,
168 &quot;booleanValue&quot;: True or False,
169 &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.
170 &quot;year&quot;: 42, # Year of date. Must be from 1 to 9999.
171 &quot;month&quot;: 42, # Month of date. Must be from 1 to 12.
172 &quot;day&quot;: 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
173 },
174 &quot;timestampValue&quot;: &quot;A String&quot;,
175 &quot;doubleValue&quot;: 3.14,
176 },
177 &quot;operatorName&quot;: &quot;A String&quot;, # The `operator_name` applied to the query, such as *price_greater_than*.
178 # The filter can work against both types of filters defined in the schema
179 # for your data source:
180 # &lt;br/&gt;&lt;br/&gt;
181 # 1. `operator_name`, where the query filters results by the property
182 # that matches the value.
183 # &lt;br/&gt;
184 # 2. `greater_than_operator_name` or `less_than_operator_name` in your
185 # schema. The query filters the results for the property values that are
186 # greater than or less than the supplied value in the query.
187 },
188 },
189 },
190 ],
191 },
192 ],
193 &quot;pageSize&quot;: 42, # Maximum number of search results to return in one page.
194 # Valid values are between 1 and 100, inclusive.
195 # Default value is 10.
196 &quot;start&quot;: 42, # Starting index of the results.
197 &quot;queryInterpretationOptions&quot;: { # Options to interpret user query. # Options to interpret the user query.
198 &quot;enableVerbatimMode&quot;: True or False, # Enable this flag to turn off all internal optimizations like natural
199 # language (NL) interpretation of queries, supplemental result retrieval,
200 # and usage of synonyms including custom ones.
201 # Nl interpretation will be disabled if either one of the two flags is true.
202 &quot;disableNlInterpretation&quot;: True or False, # Flag to disable natural language (NL) interpretation of queries. Default is
203 # false, Set to true to disable natural language interpretation. NL
204 # interpretation only applies to predefined datasources.
205 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700206 &quot;requestOptions&quot;: { # Shared request options for all RPC methods. # Request options, such as the search application and user timezone.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700207 &quot;debugOptions&quot;: { # Shared request debug options for all cloudsearch RPC methods. # Debug options of the request
208 &quot;enableDebugging&quot;: True or False, # If you are asked by Google to help with debugging, set this field.
209 # Otherwise, ignore this field.
210 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700211 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;.
212 # For more information, see
213 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
214 # For translations.
215 #
216 # Set this field using the language set in browser or for the page. In the
217 # event that the user&#x27;s language preference is known, set this field to the
218 # known user language.
219 #
220 # When specified, the documents in search results are biased towards the
221 # specified language.
222 #
223 # The suggest API does not use this parameter. Instead, suggest autocompletes
224 # only based on characters in the query.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700225 &quot;searchApplicationId&quot;: &quot;A String&quot;, # The ID generated when you create a search application using the
226 # [admin console](https://support.google.com/a/answer/9043922).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700227 &quot;timeZone&quot;: &quot;A String&quot;, # Current user&#x27;s time zone id, such as &quot;America/Los_Angeles&quot; or
228 # &quot;Australia/Sydney&quot;. These IDs are defined by
229 # [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/)
230 # project, and currently available in the file
231 # [timezone.xml](http://unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml).
232 # This field is used to correctly interpret date and time queries.
233 # If this field is not specified, the default time zone (UTC) is used.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700234 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700235 &quot;query&quot;: &quot;A String&quot;, # The raw query string.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700236 # See supported search operators in the [Cloud search
237 # Cheat
238 # Sheet](https://gsuite.google.com/learning-center/products/cloudsearch/cheat-sheet/)
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.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700250 &quot;resultCountExact&quot;: &quot;A String&quot;, # The exact result count for this query.
251 &quot;errorInfo&quot;: { # Error information about the response. # Error information about the response.
252 &quot;errorMessages&quot;: [
253 { # Error message per source response.
254 &quot;source&quot;: { # Defines sources for the suggest/search APIs.
255 &quot;name&quot;: &quot;A String&quot;, # Source name for content indexed by the
256 # Indexing API.
257 &quot;predefinedSource&quot;: &quot;A String&quot;, # Predefined content source for Google Apps.
258 },
259 &quot;errorMessage&quot;: &quot;A String&quot;,
260 },
261 ],
262 },
263 &quot;debugInfo&quot;: { # Debugging information about the response. # Debugging information about the response.
264 &quot;formattedDebugInfo&quot;: &quot;A String&quot;, # General debug info formatted for display.
265 },
266 &quot;resultCounts&quot;: { # Result count information # Expanded result count information.
267 &quot;sourceResultCounts&quot;: [ # Result count information for each source with results.
268 { # Per source result count information.
269 &quot;resultCountExact&quot;: &quot;A String&quot;, # The exact result count for this source.
270 &quot;resultCountEstimate&quot;: &quot;A String&quot;, # The estimated result count for this source.
271 &quot;hasMoreResults&quot;: True or False, # Whether there are more search results for this source.
272 &quot;source&quot;: { # Defines sources for the suggest/search APIs. # The source the result count information is associated with.
273 &quot;name&quot;: &quot;A String&quot;, # Source name for content indexed by the
274 # Indexing API.
275 &quot;predefinedSource&quot;: &quot;A String&quot;, # Predefined content source for Google Apps.
276 },
277 },
278 ],
279 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700280 &quot;results&quot;: [ # Results from a search query.
281 { # Results containing indexed information for a document.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700282 &quot;clusteredResults&quot;: [ # If source is clustered, provide list of clustered results. There will only
283 # be one level of clustered results. If current source is not enabled for
284 # clustering, this field will be empty.
285 # Object with schema name: SearchResult
286 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700287 &quot;metadata&quot;: { # Metadata of a matched search result. # Metadata of the search result.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700288 &quot;objectType&quot;: &quot;A String&quot;, # Object type of the search result.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700289 &quot;source&quot;: { # Defines sources for the suggest/search APIs. # The named source for the result, such as Gmail.
290 &quot;name&quot;: &quot;A String&quot;, # Source name for content indexed by the
291 # Indexing API.
292 &quot;predefinedSource&quot;: &quot;A String&quot;, # Predefined content source for Google Apps.
293 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700294 &quot;mimeType&quot;: &quot;A String&quot;, # Mime type of the search result.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700295 &quot;owner&quot;: { # Object to represent a person. # Owner (usually creator) of the document or object of the search result.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700296 &quot;photos&quot;: [ # A person&#x27;s read-only photo. A picture shown next to the person&#x27;s name to
297 # help others recognize the person in search results.
298 { # A person&#x27;s photo.
299 &quot;url&quot;: &quot;A String&quot;, # The URL of the photo.
300 },
301 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700302 &quot;personNames&quot;: [ # The person&#x27;s name
303 { # A person&#x27;s name.
304 &quot;displayName&quot;: &quot;A String&quot;, # The read-only display name formatted according to the locale specified by
305 # the viewer&#x27;s account or the &lt;code&gt;Accept-Language&lt;/code&gt; HTTP header.
306 },
307 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700308 &quot;emailAddresses&quot;: [ # The person&#x27;s email addresses
309 { # A person&#x27;s email address.
310 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address.
311 },
312 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700313 &quot;name&quot;: &quot;A String&quot;, # The resource name of the person to provide information about.
314 # See &lt;a href=&quot;https://developers.google.com/people/api/rest/v1/people/get&quot;&gt;
315 # People.get&lt;/a&gt; from Google People API.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700316 &quot;obfuscatedId&quot;: &quot;A String&quot;, # Obfuscated ID of a person.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700317 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700318 &quot;createTime&quot;: &quot;A String&quot;, # The creation time for this document or object in the search result.
319 &quot;displayOptions&quot;: { # Options that specify how to display a structured data search result.
320 &quot;metalines&quot;: [ # The metalines content to be displayed with the result.
321 { # The collection of fields that make up a displayed line
322 &quot;fields&quot;: [
323 { # Display Fields for Search Results
324 &quot;label&quot;: &quot;A String&quot;, # The display label for the property.
325 &quot;property&quot;: { # A typed name-value pair for structured data. The type of the value should # The name value pair for the property.
326 # be the same as the registered type for the `name` property in the object
327 # definition of `objectType`.
328 &quot;timestampValues&quot;: { # List of timestamp values.
329 &quot;values&quot;: [
330 &quot;A String&quot;,
331 ],
332 },
333 &quot;doubleValues&quot;: { # List of double values.
334 &quot;values&quot;: [
335 3.14,
336 ],
337 },
338 &quot;integerValues&quot;: { # List of integer values.
339 &quot;values&quot;: [
340 &quot;A String&quot;,
341 ],
342 },
343 &quot;dateValues&quot;: { # List of date values.
344 &quot;values&quot;: [
345 { # 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.
346 &quot;year&quot;: 42, # Year of date. Must be from 1 to 9999.
347 &quot;month&quot;: 42, # Month of date. Must be from 1 to 12.
348 &quot;day&quot;: 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
349 },
350 ],
351 },
352 &quot;enumValues&quot;: { # List of enum values.
353 &quot;values&quot;: [ # The maximum allowable length for string values is 32 characters.
354 &quot;A String&quot;,
355 ],
356 },
357 &quot;textValues&quot;: { # List of text values.
358 &quot;values&quot;: [ # The maximum allowable length for text values is 2048 characters.
359 &quot;A String&quot;,
360 ],
361 },
362 &quot;booleanValue&quot;: True or False,
363 &quot;htmlValues&quot;: { # List of html values.
364 &quot;values&quot;: [ # The maximum allowable length for html values is 2048 characters.
365 &quot;A String&quot;,
366 ],
367 },
368 &quot;name&quot;: &quot;A String&quot;, # The name of the property. This name should correspond to the name of the
369 # property that was registered for object definition in the schema.
370 # The maximum allowable length for this property is 256 characters.
371 &quot;objectValues&quot;: { # List of object values.
372 &quot;values&quot;: [
373 # Object with schema name: StructuredDataObject
374 ],
375 },
376 },
377 &quot;operatorName&quot;: &quot;A String&quot;, # The operator name of the property.
378 },
379 ],
380 },
381 ],
382 &quot;objectTypeLabel&quot;: &quot;A String&quot;, # The display label for the object.
383 },
384 &quot;updateTime&quot;: &quot;A String&quot;, # The last modified date for the object in the search result. If not
385 # set in the item, the value returned here is empty. When
386 # `updateTime` is used for calculating freshness and is not set, this
387 # value defaults to 2 years from the current time.
388 &quot;fields&quot;: [ # Indexed fields in structured data, returned as a generic named property.
389 { # A typed name-value pair for structured data. The type of the value should
390 # be the same as the registered type for the `name` property in the object
391 # definition of `objectType`.
392 &quot;timestampValues&quot;: { # List of timestamp values.
393 &quot;values&quot;: [
394 &quot;A String&quot;,
395 ],
396 },
397 &quot;doubleValues&quot;: { # List of double values.
398 &quot;values&quot;: [
399 3.14,
400 ],
401 },
402 &quot;integerValues&quot;: { # List of integer values.
403 &quot;values&quot;: [
404 &quot;A String&quot;,
405 ],
406 },
407 &quot;dateValues&quot;: { # List of date values.
408 &quot;values&quot;: [
409 { # 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.
410 &quot;year&quot;: 42, # Year of date. Must be from 1 to 9999.
411 &quot;month&quot;: 42, # Month of date. Must be from 1 to 12.
412 &quot;day&quot;: 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
413 },
414 ],
415 },
416 &quot;enumValues&quot;: { # List of enum values.
417 &quot;values&quot;: [ # The maximum allowable length for string values is 32 characters.
418 &quot;A String&quot;,
419 ],
420 },
421 &quot;textValues&quot;: { # List of text values.
422 &quot;values&quot;: [ # The maximum allowable length for text values is 2048 characters.
423 &quot;A String&quot;,
424 ],
425 },
426 &quot;booleanValue&quot;: True or False,
427 &quot;htmlValues&quot;: { # List of html values.
428 &quot;values&quot;: [ # The maximum allowable length for html values is 2048 characters.
429 &quot;A String&quot;,
430 ],
431 },
432 &quot;name&quot;: &quot;A String&quot;, # The name of the property. This name should correspond to the name of the
433 # property that was registered for object definition in the schema.
434 # The maximum allowable length for this property is 256 characters.
435 &quot;objectValues&quot;: { # List of object values.
436 &quot;values&quot;: [
437 # Object with schema name: StructuredDataObject
438 ],
439 },
440 },
441 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700442 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700443 &quot;title&quot;: &quot;A String&quot;, # Title of the search result.
444 &quot;url&quot;: &quot;A String&quot;, # The URL of the search result. The URL contains a Google redirect to the
445 # actual item. This URL is signed and shouldn&#x27;t be changed.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700446 &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.
447 # page.
448 &quot;snippet&quot;: &quot;A String&quot;, # The snippet of the document.
449 # The snippet of the document. May contain escaped HTML character that
450 # should be unescaped prior to rendering.
451 &quot;matchRanges&quot;: [ # The matched ranges in the snippet.
452 { # Matched range of a snippet [start, end).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700453 &quot;start&quot;: 42, # Starting position of the match in the snippet.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700454 &quot;end&quot;: 42, # End of the match in the snippet.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700455 },
456 ],
457 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700458 &quot;debugInfo&quot;: { # Debugging information about the result. # Debugging information about this search result.
459 &quot;formattedDebugInfo&quot;: &quot;A String&quot;, # General debug info formatted for display.
460 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700461 },
462 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700463 &quot;hasMoreResults&quot;: True or False, # Whether there are more search results matching the query.
464 &quot;spellResults&quot;: [ # Suggested spelling for the query.
465 {
466 &quot;suggestedQuery&quot;: &quot;A String&quot;, # The suggested spelling of the query.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700467 },
468 ],
469 &quot;structuredResults&quot;: [ # Structured results for the user query. These results are not counted
470 # against the page_size.
471 { # Structured results that are returned as part of search request.
472 &quot;person&quot;: { # Object to represent a person. # Representation of a person
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700473 &quot;photos&quot;: [ # A person&#x27;s read-only photo. A picture shown next to the person&#x27;s name to
474 # help others recognize the person in search results.
475 { # A person&#x27;s photo.
476 &quot;url&quot;: &quot;A String&quot;, # The URL of the photo.
477 },
478 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700479 &quot;personNames&quot;: [ # The person&#x27;s name
480 { # A person&#x27;s name.
481 &quot;displayName&quot;: &quot;A String&quot;, # The read-only display name formatted according to the locale specified by
482 # the viewer&#x27;s account or the &lt;code&gt;Accept-Language&lt;/code&gt; HTTP header.
483 },
484 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700485 &quot;emailAddresses&quot;: [ # The person&#x27;s email addresses
486 { # A person&#x27;s email address.
487 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address.
488 },
489 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700490 &quot;name&quot;: &quot;A String&quot;, # The resource name of the person to provide information about.
491 # See &lt;a href=&quot;https://developers.google.com/people/api/rest/v1/people/get&quot;&gt;
492 # People.get&lt;/a&gt; from Google People API.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700493 &quot;obfuscatedId&quot;: &quot;A String&quot;, # Obfuscated ID of a person.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700494 },
495 },
496 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700497 &quot;facetResults&quot;: [ # Repeated facet results.
498 { # Source specific facet response
499 &quot;sourceName&quot;: &quot;A String&quot;, # Source name for which facet results are returned. Will not be empty.
500 &quot;objectType&quot;: &quot;A String&quot;, # Object type for which facet results are returned. Can be empty.
501 &quot;buckets&quot;: [ # FacetBuckets for values in response containing at least a single result.
502 { # A bucket in a facet is the basic unit of operation. A bucket can comprise
503 # either a single value OR a contiguous range of values, depending on the
504 # type of the field bucketed.
505 # FacetBucket is currently used only for returning the response object.
506 &quot;value&quot;: { # Definition of a single value with generic type.
507 &quot;integerValue&quot;: &quot;A String&quot;,
508 &quot;stringValue&quot;: &quot;A String&quot;,
509 &quot;booleanValue&quot;: True or False,
510 &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.
511 &quot;year&quot;: 42, # Year of date. Must be from 1 to 9999.
512 &quot;month&quot;: 42, # Month of date. Must be from 1 to 12.
513 &quot;day&quot;: 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
514 },
515 &quot;timestampValue&quot;: &quot;A String&quot;,
516 &quot;doubleValue&quot;: 3.14,
517 },
518 &quot;percentage&quot;: 42, # Percent of results that match the bucket value. The returned value is
519 # between (0-100], and is rounded down to an integer if fractional. If the
520 # value is not explicitly returned, it represents a percentage value that
521 # rounds to 0. Percentages are returned for all searches, but are an
522 # estimate. Because percentages are always returned, you should render
523 # percentages instead of counts.
524 &quot;count&quot;: 42, # Number of results that match the bucket value. Counts are only returned
525 # for searches when count accuracy is ensured. Can be empty.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700526 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700527 ],
528 &quot;operatorName&quot;: &quot;A String&quot;, # Name of the operator chosen for faceting. @see
529 # cloudsearch.SchemaPropertyOptions
530 },
531 ],
532 &quot;resultCountEstimate&quot;: &quot;A String&quot;, # The estimated result count for this query.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700533 &quot;queryInterpretation&quot;: { # Query interpretation result for user query. Empty if query interpretation
534 # is disabled.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700535 &quot;reason&quot;: &quot;A String&quot;, # The reason for interpretation of the query. This field will not be
536 # UNSPECIFIED if the interpretation type is not NONE.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700537 &quot;interpretationType&quot;: &quot;A String&quot;,
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700538 &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 Kimd059ad82020-07-22 17:02:09 -0700565 &quot;debugOptions&quot;: { # Shared request debug options for all cloudsearch RPC methods. # Debug options of the request
566 &quot;enableDebugging&quot;: True or False, # If you are asked by Google to help with debugging, set this field.
567 # Otherwise, ignore this field.
568 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700569 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;.
570 # For more information, see
571 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
572 # For translations.
573 #
574 # Set this field using the language set in browser or for the page. In the
575 # event that the user&#x27;s language preference is known, set this field to the
576 # known user language.
577 #
578 # When specified, the documents in search results are biased towards the
579 # specified language.
580 #
581 # The suggest API does not use this parameter. Instead, suggest autocompletes
582 # only based on characters in the query.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700583 &quot;searchApplicationId&quot;: &quot;A String&quot;, # The ID generated when you create a search application using the
584 # [admin console](https://support.google.com/a/answer/9043922).
Bu Sun Kim65020912020-05-20 12:08:20 -0700585 &quot;timeZone&quot;: &quot;A String&quot;, # Current user&#x27;s time zone id, such as &quot;America/Los_Angeles&quot; or
586 # &quot;Australia/Sydney&quot;. These IDs are defined by
587 # [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/)
588 # project, and currently available in the file
589 # [timezone.xml](http://unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml).
590 # This field is used to correctly interpret date and time queries.
591 # If this field is not specified, the default time zone (UTC) is used.
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 Kimd059ad82020-07-22 17:02:09 -0700599 &quot;source&quot;: { # Defines sources for the suggest/search APIs. # The source of restriction.
600 &quot;name&quot;: &quot;A String&quot;, # Source name for content indexed by the
601 # Indexing API.
602 &quot;predefinedSource&quot;: &quot;A String&quot;, # Predefined content source for Google Apps.
603 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700604 &quot;filterOptions&quot;: [ # Filter options restricting the results. If multiple filters
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700605 # are present, they are grouped by object type before joining.
606 # Filters with the same object type are joined conjunctively, then
607 # the resulting expressions are joined disjunctively.
608 #
609 # The maximum number of elements is 20.
610 #
611 # NOTE: Suggest API supports only few filters at the moment:
Bu Sun Kim65020912020-05-20 12:08:20 -0700612 # &quot;objecttype&quot;, &quot;type&quot; and &quot;mimetype&quot;.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700613 # For now, schema specific filters cannot be used to filter suggestions.
614 { # Filter options to be applied on query.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700615 &quot;objectType&quot;: &quot;A String&quot;, # If object_type is set, only objects of that type are returned. This should
616 # correspond to the name of the object that was registered within the
617 # definition of schema. The maximum length is 256 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -0700618 &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 -0700619 # approaches: &lt;br/&gt;&lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700620 # **1. Setting a ValueFilter.** The name must match an operator_name defined in
621 # the schema for your data source.
Dan O'Mearadd494642020-05-01 07:42:23 -0700622 # &lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700623 # **2. Setting a CompositeFilter.** The filters are evaluated
624 # using the logical operator. The top-level operators can only be either an AND
625 # or a NOT. AND can appear only at the top-most level. OR can appear only under
626 # a top-level AND.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700627 &quot;compositeFilter&quot;: {
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700628 &quot;subFilters&quot;: [ # Sub filters.
629 # Object with schema name: Filter
630 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700631 &quot;logicOperator&quot;: &quot;A String&quot;, # The logic operator of the sub filter.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700632 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700633 &quot;valueFilter&quot;: {
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700634 &quot;value&quot;: { # Definition of a single value with generic type. # The value to be compared with.
635 &quot;integerValue&quot;: &quot;A String&quot;,
636 &quot;stringValue&quot;: &quot;A String&quot;,
637 &quot;booleanValue&quot;: True or False,
638 &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.
639 &quot;year&quot;: 42, # Year of date. Must be from 1 to 9999.
640 &quot;month&quot;: 42, # Month of date. Must be from 1 to 12.
641 &quot;day&quot;: 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
642 },
643 &quot;timestampValue&quot;: &quot;A String&quot;,
644 &quot;doubleValue&quot;: 3.14,
645 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700646 &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 -0700647 # The filter can work against both types of filters defined in the schema
648 # for your data source:
Dan O'Mearadd494642020-05-01 07:42:23 -0700649 # &lt;br/&gt;&lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700650 # 1. `operator_name`, where the query filters results by the property
651 # that matches the value.
Dan O'Mearadd494642020-05-01 07:42:23 -0700652 # &lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700653 # 2. `greater_than_operator_name` or `less_than_operator_name` in your
654 # schema. The query filters the results for the property values that are
655 # greater than or less than the supplied value in the query.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700656 },
657 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700658 },
659 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700660 },
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 Kimd059ad82020-07-22 17:02:09 -0700675 &quot;suggestedQuery&quot;: &quot;A String&quot;, # The suggested query that will be used for search, when the user
676 # clicks on the suggestion
Bu Sun Kim65020912020-05-20 12:08:20 -0700677 &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 -0700678 # completion.
679 # indicator that the suggest result was a phrase completion.
680 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700681 &quot;source&quot;: { # Defines sources for the suggest/search APIs. # The source of the suggestion.
Bu Sun Kim65020912020-05-20 12:08:20 -0700682 &quot;name&quot;: &quot;A String&quot;, # Source name for content indexed by the
683 # Indexing API.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700684 &quot;predefinedSource&quot;: &quot;A String&quot;, # Predefined content source for Google Apps.
Bu Sun Kim65020912020-05-20 12:08:20 -0700685 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700686 &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;photos&quot;: [ # A person&#x27;s read-only photo. A picture shown next to the person&#x27;s name to
691 # help others recognize the person in search results.
692 { # A person&#x27;s photo.
693 &quot;url&quot;: &quot;A String&quot;, # The URL of the photo.
694 },
695 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700696 &quot;personNames&quot;: [ # The person&#x27;s name
697 { # A person&#x27;s name.
698 &quot;displayName&quot;: &quot;A String&quot;, # The read-only display name formatted according to the locale specified by
699 # the viewer&#x27;s account or the &lt;code&gt;Accept-Language&lt;/code&gt; HTTP header.
700 },
701 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700702 &quot;emailAddresses&quot;: [ # The person&#x27;s email addresses
703 { # A person&#x27;s email address.
704 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address.
705 },
706 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700707 &quot;name&quot;: &quot;A String&quot;, # The resource name of the person to provide information about.
708 # See &lt;a href=&quot;https://developers.google.com/people/api/rest/v1/people/get&quot;&gt;
709 # People.get&lt;/a&gt; from Google People API.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700710 &quot;obfuscatedId&quot;: &quot;A String&quot;, # Obfuscated ID of a person.
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>