blob: 95fba864eb1ed93c80529fa7435b11b7e0be8342 [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.
97A service account can't perform Query API requests directly; to use a
98service 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.
107 "facetOptions": [
108 { # Specifies operators to return facet results for. There will be one
109 # FacetResult for every source_name/object_type/operator_name combination.
110 "sourceName": "A String", # Source name to facet on. Format: datasources/{source_id}
111 # If empty, all data sources will be used.
112 "numFacetBuckets": 42, # Maximum number of facet buckets that should be returned for this facet.
113 # Defaults to 10.
114 # Maximum value is 100.
115 "operatorName": "A String", # Name of the operator chosen for faceting. @see
116 # cloudsearch.SchemaPropertyOptions
117 "objectType": "A String", # If object_type is set, only those objects of that type will be used to
118 # compute facets. If empty, then all objects will be used to compute facets.
119 },
120 ],
121 "pageSize": 42, # Maximum number of search results to return in one page.
122 # Valid values are between 1 and 100, inclusive.
123 # Default value is 10.
124 "queryInterpretationOptions": { # Options to interpret user query. # Options to interpret the user query.
Dan O'Mearadd494642020-05-01 07:42:23 -0700125 "enableVerbatimMode": True or False, # Enable this flag to turn off all internal optimizations like natural
126 # language (NL) interpretation of queries, supplemental result retrieval,
127 # and usage of synonyms including custom ones.
128 # Nl interpretation will be disabled if either one of the two flags is true.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700129 "disableNlInterpretation": True or False, # Flag to disable natural language (NL) interpretation of queries. Default is
130 # false, Set to true to disable natural language interpretation. NL
131 # interpretation only applies to predefined datasources.
132 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700133 "requestOptions": { # Shared request options for all RPC methods. # Request options, such as the search application and user timezone.
134 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn".
135 # For more information, see
136 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
137 # For translations.
138 #
139 # Set this field using the language set in browser or for the page. In the
140 # event that the user's language preference is known, set this field to the
141 # known user language.
142 #
143 # When specified, the documents in search results are biased towards the
144 # specified language.
145 #
146 # The suggest API does not use this parameter. Instead, suggest autocompletes
147 # only based on characters in the query.
148 "debugOptions": { # Shared request debug options for all cloudsearch RPC methods. # Debug options of the request
149 "enableDebugging": True or False, # If you are asked by Google to help with debugging, set this field.
150 # Otherwise, ignore this field.
151 },
152 "searchApplicationId": "A String", # The ID generated when you create a search application using the
153 # [admin console](https://support.google.com/a/answer/9043922).
154 "timeZone": "A String", # Current user's time zone id, such as "America/Los_Angeles" or
155 # "Australia/Sydney". These IDs are defined by
156 # [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/)
157 # project, and currently available in the file
158 # [timezone.xml](http://unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml).
159 # This field is used to correctly interpret date and time queries.
160 # If this field is not specified, the default time zone (UTC) is used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700161 },
162 "dataSourceRestrictions": [ # The sources to use for querying. If not specified, all data sources
163 # from the current search application are used.
164 { # Restriction on Datasource.
165 "filterOptions": [ # Filter options restricting the results. If multiple filters
166 # are present, they are grouped by object type before joining.
167 # Filters with the same object type are joined conjunctively, then
168 # the resulting expressions are joined disjunctively.
169 #
170 # The maximum number of elements is 20.
171 #
172 # NOTE: Suggest API supports only few filters at the moment:
173 # "objecttype", "type" and "mimetype".
174 # For now, schema specific filters cannot be used to filter suggestions.
175 { # Filter options to be applied on query.
176 "filter": { # 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 -0700177 # approaches: &lt;br/&gt;&lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700178 # **1. Setting a ValueFilter.** The name must match an operator_name defined in
179 # the schema for your data source.
Dan O'Mearadd494642020-05-01 07:42:23 -0700180 # &lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700181 # **2. Setting a CompositeFilter.** The filters are evaluated
182 # using the logical operator. The top-level operators can only be either an AND
183 # or a NOT. AND can appear only at the top-most level. OR can appear only under
184 # a top-level AND.
185 "compositeFilter": {
186 "subFilters": [ # Sub filters.
187 # Object with schema name: Filter
188 ],
189 "logicOperator": "A String", # The logic operator of the sub filter.
190 },
191 "valueFilter": {
192 "operatorName": "A String", # The `operator_name` applied to the query, such as *price_greater_than*.
193 # The filter can work against both types of filters defined in the schema
194 # for your data source:
Dan O'Mearadd494642020-05-01 07:42:23 -0700195 # &lt;br/&gt;&lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700196 # 1. `operator_name`, where the query filters results by the property
197 # that matches the value.
Dan O'Mearadd494642020-05-01 07:42:23 -0700198 # &lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700199 # 2. `greater_than_operator_name` or `less_than_operator_name` in your
200 # schema. The query filters the results for the property values that are
201 # greater than or less than the supplied value in the query.
202 "value": { # Definition of a single value with generic type. # The value to be compared with.
203 "timestampValue": "A String",
204 "doubleValue": 3.14,
205 "dateValue": { # 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 Kim715bd7f2019-06-14 16:50:42 -0700206 "year": 42, # Year of date. Must be from 1 to 9999.
Dan O'Mearadd494642020-05-01 07:42:23 -0700207 "day": 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
208 "month": 42, # Month of date. Must be from 1 to 12.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700209 },
210 "stringValue": "A String",
211 "booleanValue": True or False,
212 "integerValue": "A String",
213 },
214 },
215 },
216 "objectType": "A String", # If object_type is set, only objects of that type are returned. This should
217 # correspond to the name of the object that was registered within the
218 # definition of schema. The maximum length is 256 characters.
219 },
220 ],
221 "source": { # Defines sources for the suggest/search APIs. # The source of restriction.
222 "predefinedSource": "A String", # Predefined content source for Google Apps.
223 "name": "A String", # Source name for content indexed by the
224 # Indexing API.
225 },
226 },
227 ],
228 "start": 42, # Starting index of the results.
229 "query": "A String", # The raw query string.
230 # See supported search operators in the [Cloud search
231 # Cheat
232 # Sheet](https://gsuite.google.com/learning-center/products/cloudsearch/cheat-sheet/)
Dan O'Mearadd494642020-05-01 07:42:23 -0700233 "sortOptions": { # The options for sorting the search results
234 "operatorName": "A String", # Name of the operator corresponding to the field to sort on.
235 # The corresponding property must be marked as
236 # sortable.
237 "sortOrder": "A String", # Ascending is the default sort order
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700238 },
239 }
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 "structuredResults": [ # Structured results for the user query. These results are not counted
251 # against the page_size.
252 { # Structured results that are returned as part of search request.
253 "person": { # Object to represent a person. # Representation of a person
254 "photos": [ # A person's read-only photo. A picture shown next to the person's name to
255 # help others recognize the person in search results.
256 { # A person's photo.
257 "url": "A String", # The URL of the photo.
258 },
259 ],
260 "emailAddresses": [ # The person's email addresses
261 { # A person's email address.
262 "emailAddress": "A String", # The email address.
263 },
264 ],
265 "name": "A String", # The resource name of the person to provide information about.
Dan O'Mearadd494642020-05-01 07:42:23 -0700266 # See &lt;a href="https://developers.google.com/people/api/rest/v1/people/get"&gt;
267 # People.get&lt;/a&gt; from Google People API.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700268 "personNames": [ # The person's name
269 { # A person's name.
270 "displayName": "A String", # The read-only display name formatted according to the locale specified by
Dan O'Mearadd494642020-05-01 07:42:23 -0700271 # the viewer's account or the &lt;code&gt;Accept-Language&lt;/code&gt; HTTP header.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700272 },
273 ],
274 "obfuscatedId": "A String", # Obfuscated ID of a person.
275 },
276 },
277 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700278 "hasMoreResults": True or False, # Whether there are more search results matching the query.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700279 "debugInfo": { # Debugging information about the response. # Debugging information about the response.
280 "formattedDebugInfo": "A String", # General debug info formatted for display.
281 },
282 "spellResults": [ # Suggested spelling for the query.
283 {
284 "suggestedQuery": "A String", # The suggested spelling of the query.
285 },
286 ],
287 "results": [ # Results from a search query.
288 { # Results containing indexed information for a document.
289 "title": "A String", # Title of the search result.
290 "debugInfo": { # Debugging information about the result. # Debugging information about this search result.
291 "formattedDebugInfo": "A String", # General debug info formatted for display.
292 },
293 "snippet": { # Snippet of the search result, which summarizes the content of the resulting # The concatenation of all snippets (summaries) available for this result.
294 # page.
295 "snippet": "A String", # The snippet of the document.
296 # The snippet of the document. May contain escaped HTML character that
297 # should be unescaped prior to rendering.
298 "matchRanges": [ # The matched ranges in the snippet.
299 { # Matched range of a snippet [start, end).
300 "start": 42, # Starting position of the match in the snippet.
301 "end": 42, # End of the match in the snippet.
302 },
303 ],
304 },
305 "url": "A String", # The URL of the search result. The URL contains a Google redirect to the
306 # actual item. This URL is signed and shouldn't be changed.
307 "clusteredResults": [ # If source is clustered, provide list of clustered results. There will only
308 # be one level of clustered results. If current source is not enabled for
309 # clustering, this field will be empty.
310 # Object with schema name: SearchResult
311 ],
312 "metadata": { # Metadata of a matched search result. # Metadata of the search result.
313 "mimeType": "A String", # Mime type of the search result.
314 "updateTime": "A String", # The last modified date for the object in the search result. If not
315 # set in the item, the value returned here is empty. When
316 # `updateTime` is used for calculating freshness and is not set, this
317 # value defaults to 2 years from the current time.
318 "fields": [ # Indexed fields in structured data, returned as a generic named property.
319 { # A typed name-value pair for structured data. The type of the value should
320 # be the same as the registered type for the `name` property in the object
321 # definition of `objectType`.
322 "objectValues": { # List of object values.
323 "values": [
324 # Object with schema name: StructuredDataObject
325 ],
326 },
327 "dateValues": { # List of date values.
328 "values": [
329 { # 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 Kim715bd7f2019-06-14 16:50:42 -0700330 "year": 42, # Year of date. Must be from 1 to 9999.
Dan O'Mearadd494642020-05-01 07:42:23 -0700331 "day": 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
332 "month": 42, # Month of date. Must be from 1 to 12.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700333 },
334 ],
335 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700336 "name": "A String", # The name of the property. This name should correspond to the name of the
337 # property that was registered for object definition in the schema.
338 # The maximum allowable length for this property is 256 characters.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700339 "enumValues": { # List of enum values.
340 "values": [ # The maximum allowable length for string values is 32 characters.
341 "A String",
342 ],
343 },
344 "integerValues": { # List of integer values.
345 "values": [
346 "A String",
347 ],
348 },
349 "doubleValues": { # List of double values.
350 "values": [
351 3.14,
352 ],
353 },
354 "htmlValues": { # List of html values.
355 "values": [ # The maximum allowable length for html values is 2048 characters.
356 "A String",
357 ],
358 },
359 "booleanValue": True or False,
360 "timestampValues": { # List of timestamp values.
361 "values": [
362 "A String",
363 ],
364 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700365 "textValues": { # List of text values.
366 "values": [ # The maximum allowable length for text values is 2048 characters.
367 "A String",
368 ],
369 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700370 },
371 ],
372 "source": { # Defines sources for the suggest/search APIs. # The named source for the result, such as Gmail.
373 "predefinedSource": "A String", # Predefined content source for Google Apps.
374 "name": "A String", # Source name for content indexed by the
375 # Indexing API.
376 },
377 "owner": { # Object to represent a person. # Owner (usually creator) of the document or object of the search result.
378 "photos": [ # A person's read-only photo. A picture shown next to the person's name to
379 # help others recognize the person in search results.
380 { # A person's photo.
381 "url": "A String", # The URL of the photo.
382 },
383 ],
384 "emailAddresses": [ # The person's email addresses
385 { # A person's email address.
386 "emailAddress": "A String", # The email address.
387 },
388 ],
389 "name": "A String", # The resource name of the person to provide information about.
Dan O'Mearadd494642020-05-01 07:42:23 -0700390 # See &lt;a href="https://developers.google.com/people/api/rest/v1/people/get"&gt;
391 # People.get&lt;/a&gt; from Google People API.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700392 "personNames": [ # The person's name
393 { # A person's name.
394 "displayName": "A String", # The read-only display name formatted according to the locale specified by
Dan O'Mearadd494642020-05-01 07:42:23 -0700395 # the viewer's account or the &lt;code&gt;Accept-Language&lt;/code&gt; HTTP header.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700396 },
397 ],
398 "obfuscatedId": "A String", # Obfuscated ID of a person.
399 },
400 "createTime": "A String", # The creation time for this document or object in the search result.
401 "displayOptions": { # Options that specify how to display a structured data search result.
402 "objectTypeLabel": "A String", # The display label for the object.
403 "metalines": [ # The metalines content to be displayed with the result.
404 { # The collection of fields that make up a displayed line
405 "fields": [
406 { # Display Fields for Search Results
407 "property": { # A typed name-value pair for structured data. The type of the value should # The name value pair for the property.
408 # be the same as the registered type for the `name` property in the object
409 # definition of `objectType`.
410 "objectValues": { # List of object values.
411 "values": [
412 # Object with schema name: StructuredDataObject
413 ],
414 },
415 "dateValues": { # List of date values.
416 "values": [
417 { # 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 Kim715bd7f2019-06-14 16:50:42 -0700418 "year": 42, # Year of date. Must be from 1 to 9999.
Dan O'Mearadd494642020-05-01 07:42:23 -0700419 "day": 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
420 "month": 42, # Month of date. Must be from 1 to 12.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700421 },
422 ],
423 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700424 "name": "A String", # The name of the property. This name should correspond to the name of the
425 # property that was registered for object definition in the schema.
426 # The maximum allowable length for this property is 256 characters.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700427 "enumValues": { # List of enum values.
428 "values": [ # The maximum allowable length for string values is 32 characters.
429 "A String",
430 ],
431 },
432 "integerValues": { # List of integer values.
433 "values": [
434 "A String",
435 ],
436 },
437 "doubleValues": { # List of double values.
438 "values": [
439 3.14,
440 ],
441 },
442 "htmlValues": { # List of html values.
443 "values": [ # The maximum allowable length for html values is 2048 characters.
444 "A String",
445 ],
446 },
447 "booleanValue": True or False,
448 "timestampValues": { # List of timestamp values.
449 "values": [
450 "A String",
451 ],
452 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700453 "textValues": { # List of text values.
454 "values": [ # The maximum allowable length for text values is 2048 characters.
455 "A String",
456 ],
457 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700458 },
459 "operatorName": "A String", # The operator name of the property.
460 "label": "A String", # The display label for the property.
461 },
462 ],
463 },
464 ],
465 },
466 "objectType": "A String", # Object type of the search result.
467 },
468 },
469 ],
470 "resultCounts": { # Result count information # Expanded result count information.
471 "sourceResultCounts": [ # Result count information for each source with results.
472 { # Per source result count information.
473 "source": { # Defines sources for the suggest/search APIs. # The source the result count information is associated with.
474 "predefinedSource": "A String", # Predefined content source for Google Apps.
475 "name": "A String", # Source name for content indexed by the
476 # Indexing API.
477 },
478 "resultCountExact": "A String", # The exact result count for this source.
479 "hasMoreResults": True or False, # Whether there are more search results for this source.
480 "resultCountEstimate": "A String", # The estimated result count for this source.
481 },
482 ],
483 },
484 "resultCountEstimate": "A String", # The estimated result count for this query.
485 "resultCountExact": "A String", # The exact result count for this query.
486 "facetResults": [ # Repeated facet results.
487 { # Source specific facet response
488 "sourceName": "A String", # Source name for which facet results are returned. Will not be empty.
489 "buckets": [ # FacetBuckets for values in response containing at least a single result.
490 { # A bucket in a facet is the basic unit of operation. A bucket can comprise
491 # either a single value OR a contiguous range of values, depending on the
492 # type of the field bucketed.
493 # FacetBucket is currently used only for returning the response object.
494 "count": 42, # Number of results that match the bucket value. Counts are only returned
495 # for searches when count accuracy is ensured. Can be empty.
496 "percentage": 42, # Percent of results that match the bucket value. This value is between
497 # (0-100]. Percentages are returned for all searches, but are an estimate.
498 # Because percentages are always returned, you should render percentages
499 # instead of counts.
500 "value": { # Definition of a single value with generic type.
501 "timestampValue": "A String",
502 "doubleValue": 3.14,
503 "dateValue": { # 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 Kim715bd7f2019-06-14 16:50:42 -0700504 "year": 42, # Year of date. Must be from 1 to 9999.
Dan O'Mearadd494642020-05-01 07:42:23 -0700505 "day": 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
506 "month": 42, # Month of date. Must be from 1 to 12.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700507 },
508 "stringValue": "A String",
509 "booleanValue": True or False,
510 "integerValue": "A String",
511 },
512 },
513 ],
514 "operatorName": "A String", # Name of the operator chosen for faceting. @see
515 # cloudsearch.SchemaPropertyOptions
516 "objectType": "A String", # Object type for which facet results are returned. Can be empty.
517 },
518 ],
519 "errorInfo": { # Error information about the response. # Error information about the response.
520 "errorMessages": [
521 { # Error message per source response.
522 "source": { # Defines sources for the suggest/search APIs.
523 "predefinedSource": "A String", # Predefined content source for Google Apps.
524 "name": "A String", # Source name for content indexed by the
525 # Indexing API.
526 },
527 "errorMessage": "A String",
528 },
529 ],
530 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700531 "queryInterpretation": { # Query interpretation result for user query. Empty if query interpretation
532 # is disabled.
533 "interpretedQuery": "A String", # The interpretation of the query used in search. For example, queries with
534 # natural language intent like "email from john" will be interpreted as
535 # "from:john source:mail". This field will not be filled when the reason is
536 # NOT_ENOUGH_RESULTS_FOUND_FOR_USER_QUERY.
537 "interpretationType": "A String",
538 "reason": "A String", # The reason for interpretation of the query. This field will not be
539 # UNSPECIFIED if the interpretation type is not NONE.
540 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700541 }</pre>
542</div>
543
544<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700545 <code class="details" id="suggest">suggest(body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700546 <pre>Provides suggestions for autocompleting the query.
547
Dan O'Mearadd494642020-05-01 07:42:23 -0700548**Note:** This API requires a standard end user account to execute.
549A service account can't perform Query API requests directly; to use a
550service account to perform queries, set up [G Suite domain-wide delegation
551of
552authority](https://developers.google.com/cloud-search/docs/guides/delegation/).
553
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700554Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700555 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700556 The object takes the form of:
557
558{ # Request of suggest API.
Dan O'Mearadd494642020-05-01 07:42:23 -0700559 "dataSourceRestrictions": [ # The sources to use for suggestions. If not specified, the data sources
560 # are taken from the current search application.
561 #
562 # NOTE: Suggestions are supported only for third party data sources and
563 # people (i.e. PredefinedSource.PERSON).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700564 { # Restriction on Datasource.
565 "filterOptions": [ # Filter options restricting the results. If multiple filters
566 # are present, they are grouped by object type before joining.
567 # Filters with the same object type are joined conjunctively, then
568 # the resulting expressions are joined disjunctively.
569 #
570 # The maximum number of elements is 20.
571 #
572 # NOTE: Suggest API supports only few filters at the moment:
573 # "objecttype", "type" and "mimetype".
574 # For now, schema specific filters cannot be used to filter suggestions.
575 { # Filter options to be applied on query.
576 "filter": { # 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 -0700577 # approaches: &lt;br/&gt;&lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700578 # **1. Setting a ValueFilter.** The name must match an operator_name defined in
579 # the schema for your data source.
Dan O'Mearadd494642020-05-01 07:42:23 -0700580 # &lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700581 # **2. Setting a CompositeFilter.** The filters are evaluated
582 # using the logical operator. The top-level operators can only be either an AND
583 # or a NOT. AND can appear only at the top-most level. OR can appear only under
584 # a top-level AND.
585 "compositeFilter": {
586 "subFilters": [ # Sub filters.
587 # Object with schema name: Filter
588 ],
589 "logicOperator": "A String", # The logic operator of the sub filter.
590 },
591 "valueFilter": {
592 "operatorName": "A String", # The `operator_name` applied to the query, such as *price_greater_than*.
593 # The filter can work against both types of filters defined in the schema
594 # for your data source:
Dan O'Mearadd494642020-05-01 07:42:23 -0700595 # &lt;br/&gt;&lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700596 # 1. `operator_name`, where the query filters results by the property
597 # that matches the value.
Dan O'Mearadd494642020-05-01 07:42:23 -0700598 # &lt;br/&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700599 # 2. `greater_than_operator_name` or `less_than_operator_name` in your
600 # schema. The query filters the results for the property values that are
601 # greater than or less than the supplied value in the query.
602 "value": { # Definition of a single value with generic type. # The value to be compared with.
603 "timestampValue": "A String",
604 "doubleValue": 3.14,
605 "dateValue": { # 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 Kim715bd7f2019-06-14 16:50:42 -0700606 "year": 42, # Year of date. Must be from 1 to 9999.
Dan O'Mearadd494642020-05-01 07:42:23 -0700607 "day": 42, # Day of month. Must be from 1 to 31 and valid for the year and month.
608 "month": 42, # Month of date. Must be from 1 to 12.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700609 },
610 "stringValue": "A String",
611 "booleanValue": True or False,
612 "integerValue": "A String",
613 },
614 },
615 },
616 "objectType": "A String", # If object_type is set, only objects of that type are returned. This should
617 # correspond to the name of the object that was registered within the
618 # definition of schema. The maximum length is 256 characters.
619 },
620 ],
621 "source": { # Defines sources for the suggest/search APIs. # The source of restriction.
622 "predefinedSource": "A String", # Predefined content source for Google Apps.
623 "name": "A String", # Source name for content indexed by the
624 # Indexing API.
625 },
626 },
627 ],
628 "query": "A String", # Partial query for which autocomplete suggestions will be shown.
629 # For example, if the query is "sea", then the server might return
630 # "season", "search", "seagull" and so on.
631 "requestOptions": { # Shared request options for all RPC methods. # Request options, such as the search application and user timezone.
632 "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn".
633 # For more information, see
634 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
635 # For translations.
636 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700637 # Set this field using the language set in browser or for the page. In the
638 # event that the user's language preference is known, set this field to the
639 # known user language.
640 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700641 # When specified, the documents in search results are biased towards the
642 # specified language.
Dan O'Mearadd494642020-05-01 07:42:23 -0700643 #
644 # The suggest API does not use this parameter. Instead, suggest autocompletes
645 # only based on characters in the query.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700646 "debugOptions": { # Shared request debug options for all cloudsearch RPC methods. # Debug options of the request
647 "enableDebugging": True or False, # If you are asked by Google to help with debugging, set this field.
648 # Otherwise, ignore this field.
649 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700650 "searchApplicationId": "A String", # The ID generated when you create a search application using the
651 # [admin console](https://support.google.com/a/answer/9043922).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700652 "timeZone": "A String", # Current user's time zone id, such as "America/Los_Angeles" or
653 # "Australia/Sydney". These IDs are defined by
654 # [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/)
655 # project, and currently available in the file
Dan O'Mearadd494642020-05-01 07:42:23 -0700656 # [timezone.xml](http://unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml).
657 # This field is used to correctly interpret date and time queries.
658 # If this field is not specified, the default time zone (UTC) is used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700659 },
660 }
661
662 x__xgafv: string, V1 error format.
663 Allowed values
664 1 - v1 error format
665 2 - v2 error format
666
667Returns:
668 An object of the form:
669
670 { # Response of the suggest API.
671 "suggestResults": [ # List of suggestions.
672 { # One suggestion result.
673 "source": { # Defines sources for the suggest/search APIs. # The source of the suggestion.
674 "predefinedSource": "A String", # Predefined content source for Google Apps.
675 "name": "A String", # Source name for content indexed by the
676 # Indexing API.
677 },
678 "peopleSuggestion": { # This field contains information about the person being suggested. # This is present when the suggestion indicates a person. It
679 # contains more information about the person - like their email ID,
680 # name etc.
681 "person": { # Object to represent a person. # Suggested person. All fields of the person object might not be populated.
682 "photos": [ # A person's read-only photo. A picture shown next to the person's name to
683 # help others recognize the person in search results.
684 { # A person's photo.
685 "url": "A String", # The URL of the photo.
686 },
687 ],
688 "emailAddresses": [ # The person's email addresses
689 { # A person's email address.
690 "emailAddress": "A String", # The email address.
691 },
692 ],
693 "name": "A String", # The resource name of the person to provide information about.
Dan O'Mearadd494642020-05-01 07:42:23 -0700694 # See &lt;a href="https://developers.google.com/people/api/rest/v1/people/get"&gt;
695 # People.get&lt;/a&gt; from Google People API.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700696 "personNames": [ # The person's name
697 { # A person's name.
698 "displayName": "A String", # The read-only display name formatted according to the locale specified by
Dan O'Mearadd494642020-05-01 07:42:23 -0700699 # the viewer's account or the &lt;code&gt;Accept-Language&lt;/code&gt; HTTP header.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700700 },
701 ],
702 "obfuscatedId": "A String", # Obfuscated ID of a person.
703 },
704 },
705 "suggestedQuery": "A String", # The suggested query that will be used for search, when the user
706 # clicks on the suggestion
707 "querySuggestion": { # 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
708 # completion.
709 # indicator that the suggest result was a phrase completion.
710 },
711 },
712 ],
713 }</pre>
714</div>
715
716</body></html>