Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 83 | <code><a href="#search">search(body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 84 | <p class="firstline">The Cloud Search Query API provides the search method, which returns</p> |
| 85 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 86 | <code><a href="#suggest">suggest(body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 87 | <p class="firstline">Provides suggestions for autocompleting the query.</p> |
| 88 | <h3>Method Details</h3> |
| 89 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 90 | <code class="details" id="search">search(body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 91 | <pre>The Cloud Search Query API provides the search method, which returns |
| 92 | the most relevant results from a user query. The results can come from |
| 93 | G Suite Apps, such as Gmail or Google Drive, or they can come from data |
| 94 | that you have indexed from a third party. |
| 95 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 96 | **Note:** This API requires a standard end user account to execute. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 97 | A service account can't perform Query API requests directly; to use a |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 98 | service account to perform queries, set up [G Suite domain-wide delegation |
| 99 | of |
| 100 | authority](https://developers.google.com/cloud-search/docs/guides/delegation/). |
| 101 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 102 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 103 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 104 | The object takes the form of: |
| 105 | |
| 106 | { # The search API request. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 107 | "requestOptions": { # Shared request options for all RPC methods. # Request options, such as the search application and user timezone. |
| 108 | "searchApplicationId": "A String", # The ID generated when you create a search application using the |
| 109 | # [admin console](https://support.google.com/a/answer/9043922). |
| 110 | "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". |
| 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'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 | "timeZone": "A String", # Current user's time zone id, such as "America/Los_Angeles" or |
| 125 | # "Australia/Sydney". 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 | "debugOptions": { # Shared request debug options for all cloudsearch RPC methods. # Debug options of the request |
| 132 | "enableDebugging": 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 Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 136 | "dataSourceRestrictions": [ # The sources to use for querying. If not specified, all data sources |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 137 | # from the current search application are used. |
| 138 | { # Restriction on Datasource. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 139 | "filterOptions": [ # Filter options restricting the results. If multiple filters |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 140 | # 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 Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 147 | # "objecttype", "type" and "mimetype". |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 148 | # For now, schema specific filters cannot be used to filter suggestions. |
| 149 | { # Filter options to be applied on query. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 150 | "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'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 151 | # approaches: <br/><br/> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 152 | # **1. Setting a ValueFilter.** The name must match an operator_name defined in |
| 153 | # the schema for your data source. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 154 | # <br/> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 155 | # **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 Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 159 | "compositeFilter": { |
| 160 | "logicOperator": "A String", # The logic operator of the sub filter. |
| 161 | "subFilters": [ # Sub filters. |
| 162 | # Object with schema name: Filter |
| 163 | ], |
| 164 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 165 | "valueFilter": { |
| 166 | "operatorName": "A String", # The `operator_name` applied to the query, such as *price_greater_than*. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 167 | # The filter can work against both types of filters defined in the schema |
| 168 | # for your data source: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 169 | # <br/><br/> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 170 | # 1. `operator_name`, where the query filters results by the property |
| 171 | # that matches the value. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 172 | # <br/> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 173 | # 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 Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 176 | "value": { # Definition of a single value with generic type. # The value to be compared with. |
| 177 | "integerValue": "A String", |
| 178 | "stringValue": "A String", |
| 179 | "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 Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 180 | "month": 42, # Month of date. Must be from 1 to 12. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 181 | "day": 42, # Day of month. Must be from 1 to 31 and valid for the year and month. |
| 182 | "year": 42, # Year of date. Must be from 1 to 9999. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 183 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 184 | "doubleValue": 3.14, |
| 185 | "timestampValue": "A String", |
| 186 | "booleanValue": True or False, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 187 | }, |
| 188 | }, |
| 189 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 190 | "objectType": "A String", # If object_type is set, only objects of that type are returned. This should |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 191 | # 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 Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 195 | "source": { # Defines sources for the suggest/search APIs. # The source of restriction. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 196 | "name": "A String", # Source name for content indexed by the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 197 | # Indexing API. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 198 | "predefinedSource": "A String", # Predefined content source for Google Apps. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 199 | }, |
| 200 | }, |
| 201 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 202 | "sortOptions": { # The options for sorting the search results |
| 203 | "sortOrder": "A String", # Ascending is the default sort order |
| 204 | "operatorName": "A String", # Name of the operator corresponding to the field to sort on. |
| 205 | # The corresponding property must be marked as |
| 206 | # sortable. |
| 207 | }, |
| 208 | "facetOptions": [ |
| 209 | { # Specifies operators to return facet results for. There will be one |
| 210 | # FacetResult for every source_name/object_type/operator_name combination. |
| 211 | "numFacetBuckets": 42, # Maximum number of facet buckets that should be returned for this facet. |
| 212 | # Defaults to 10. |
| 213 | # Maximum value is 100. |
| 214 | "sourceName": "A String", # Source name to facet on. Format: datasources/{source_id} |
| 215 | # If empty, all data sources will be used. |
| 216 | "operatorName": "A String", # Name of the operator chosen for faceting. @see |
| 217 | # cloudsearch.SchemaPropertyOptions |
| 218 | "objectType": "A String", # 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 | "pageSize": 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 | "query": "A String", # The raw query string. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 226 | # See supported search operators in the [Cloud search |
| 227 | # Cheat |
| 228 | # Sheet](https://gsuite.google.com/learning-center/products/cloudsearch/cheat-sheet/) |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 229 | "start": 42, # Starting index of the results. |
| 230 | "queryInterpretationOptions": { # Options to interpret user query. # Options to interpret the user query. |
| 231 | "enableVerbatimMode": 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 | "disableNlInterpretation": 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 Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | x__xgafv: string, V1 error format. |
| 242 | Allowed values |
| 243 | 1 - v1 error format |
| 244 | 2 - v2 error format |
| 245 | |
| 246 | Returns: |
| 247 | An object of the form: |
| 248 | |
| 249 | { # The search API response. |
| 250 | "results": [ # Results from a search query. |
| 251 | { # Results containing indexed information for a document. |
| 252 | "debugInfo": { # Debugging information about the result. # Debugging information about this search result. |
| 253 | "formattedDebugInfo": "A String", # General debug info formatted for display. |
| 254 | }, |
| 255 | "clusteredResults": [ # 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 | "url": "A String", # The URL of the search result. The URL contains a Google redirect to the |
| 261 | # actual item. This URL is signed and shouldn't be changed. |
| 262 | "metadata": { # Metadata of a matched search result. # Metadata of the search result. |
| 263 | "displayOptions": { # Options that specify how to display a structured data search result. |
| 264 | "objectTypeLabel": "A String", # The display label for the object. |
| 265 | "metalines": [ # The metalines content to be displayed with the result. |
| 266 | { # The collection of fields that make up a displayed line |
| 267 | "fields": [ |
| 268 | { # Display Fields for Search Results |
| 269 | "operatorName": "A String", # The operator name of the property. |
| 270 | "label": "A String", # The display label for the property. |
| 271 | "property": { # 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 | "integerValues": { # List of integer values. |
| 275 | "values": [ |
| 276 | "A String", |
| 277 | ], |
| 278 | }, |
| 279 | "name": "A String", # 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 | "doubleValues": { # List of double values. |
| 283 | "values": [ |
| 284 | 3.14, |
| 285 | ], |
| 286 | }, |
| 287 | "booleanValue": True or False, |
| 288 | "htmlValues": { # List of html values. |
| 289 | "values": [ # The maximum allowable length for html values is 2048 characters. |
| 290 | "A String", |
| 291 | ], |
| 292 | }, |
| 293 | "textValues": { # List of text values. |
| 294 | "values": [ # The maximum allowable length for text values is 2048 characters. |
| 295 | "A String", |
| 296 | ], |
| 297 | }, |
| 298 | "timestampValues": { # List of timestamp values. |
| 299 | "values": [ |
| 300 | "A String", |
| 301 | ], |
| 302 | }, |
| 303 | "objectValues": { # List of object values. |
| 304 | "values": [ |
| 305 | # Object with schema name: StructuredDataObject |
| 306 | ], |
| 307 | }, |
| 308 | "dateValues": { # List of date values. |
| 309 | "values": [ |
| 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 | "month": 42, # Month of date. Must be from 1 to 12. |
| 312 | "day": 42, # Day of month. Must be from 1 to 31 and valid for the year and month. |
| 313 | "year": 42, # Year of date. Must be from 1 to 9999. |
| 314 | }, |
| 315 | ], |
| 316 | }, |
| 317 | "enumValues": { # List of enum values. |
| 318 | "values": [ # The maximum allowable length for string values is 32 characters. |
| 319 | "A String", |
| 320 | ], |
| 321 | }, |
| 322 | }, |
| 323 | }, |
| 324 | ], |
| 325 | }, |
| 326 | ], |
| 327 | }, |
| 328 | "source": { # Defines sources for the suggest/search APIs. # The named source for the result, such as Gmail. |
| 329 | "name": "A String", # Source name for content indexed by the |
| 330 | # Indexing API. |
| 331 | "predefinedSource": "A String", # Predefined content source for Google Apps. |
| 332 | }, |
| 333 | "createTime": "A String", # The creation time for this document or object in the search result. |
| 334 | "updateTime": "A String", # 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 | "fields": [ # 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 | "integerValues": { # List of integer values. |
| 343 | "values": [ |
| 344 | "A String", |
| 345 | ], |
| 346 | }, |
| 347 | "name": "A String", # 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 | "doubleValues": { # List of double values. |
| 351 | "values": [ |
| 352 | 3.14, |
| 353 | ], |
| 354 | }, |
| 355 | "booleanValue": True or False, |
| 356 | "htmlValues": { # List of html values. |
| 357 | "values": [ # The maximum allowable length for html values is 2048 characters. |
| 358 | "A String", |
| 359 | ], |
| 360 | }, |
| 361 | "textValues": { # List of text values. |
| 362 | "values": [ # The maximum allowable length for text values is 2048 characters. |
| 363 | "A String", |
| 364 | ], |
| 365 | }, |
| 366 | "timestampValues": { # List of timestamp values. |
| 367 | "values": [ |
| 368 | "A String", |
| 369 | ], |
| 370 | }, |
| 371 | "objectValues": { # List of object values. |
| 372 | "values": [ |
| 373 | # Object with schema name: StructuredDataObject |
| 374 | ], |
| 375 | }, |
| 376 | "dateValues": { # List of date values. |
| 377 | "values": [ |
| 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 | "month": 42, # Month of date. Must be from 1 to 12. |
| 380 | "day": 42, # Day of month. Must be from 1 to 31 and valid for the year and month. |
| 381 | "year": 42, # Year of date. Must be from 1 to 9999. |
| 382 | }, |
| 383 | ], |
| 384 | }, |
| 385 | "enumValues": { # List of enum values. |
| 386 | "values": [ # The maximum allowable length for string values is 32 characters. |
| 387 | "A String", |
| 388 | ], |
| 389 | }, |
| 390 | }, |
| 391 | ], |
| 392 | "owner": { # Object to represent a person. # Owner (usually creator) of the document or object of the search result. |
| 393 | "obfuscatedId": "A String", # Obfuscated ID of a person. |
| 394 | "photos": [ # A person's read-only photo. A picture shown next to the person's name to |
| 395 | # help others recognize the person in search results. |
| 396 | { # A person's photo. |
| 397 | "url": "A String", # The URL of the photo. |
| 398 | }, |
| 399 | ], |
| 400 | "emailAddresses": [ # The person's email addresses |
| 401 | { # A person's email address. |
| 402 | "emailAddress": "A String", # The email address. |
| 403 | }, |
| 404 | ], |
| 405 | "personNames": [ # The person's name |
| 406 | { # A person's name. |
| 407 | "displayName": "A String", # The read-only display name formatted according to the locale specified by |
| 408 | # the viewer's account or the <code>Accept-Language</code> HTTP header. |
| 409 | }, |
| 410 | ], |
| 411 | "name": "A String", # The resource name of the person to provide information about. |
| 412 | # See <a href="https://developers.google.com/people/api/rest/v1/people/get"> |
| 413 | # People.get</a> from Google People API. |
| 414 | }, |
| 415 | "mimeType": "A String", # Mime type of the search result. |
| 416 | "objectType": "A String", # Object type of the search result. |
| 417 | }, |
| 418 | "snippet": { # 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 | "snippet": "A String", # 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 | "matchRanges": [ # The matched ranges in the snippet. |
| 424 | { # Matched range of a snippet [start, end). |
| 425 | "end": 42, # End of the match in the snippet. |
| 426 | "start": 42, # Starting position of the match in the snippet. |
| 427 | }, |
| 428 | ], |
| 429 | }, |
| 430 | "title": "A String", # Title of the search result. |
| 431 | }, |
| 432 | ], |
| 433 | "debugInfo": { # Debugging information about the response. # Debugging information about the response. |
| 434 | "formattedDebugInfo": "A String", # General debug info formatted for display. |
| 435 | }, |
| 436 | "resultCountEstimate": "A String", # The estimated result count for this query. |
| 437 | "resultCounts": { # Result count information # Expanded result count information. |
| 438 | "sourceResultCounts": [ # Result count information for each source with results. |
| 439 | { # Per source result count information. |
| 440 | "resultCountEstimate": "A String", # The estimated result count for this source. |
| 441 | "hasMoreResults": True or False, # Whether there are more search results for this source. |
| 442 | "source": { # Defines sources for the suggest/search APIs. # The source the result count information is associated with. |
| 443 | "name": "A String", # Source name for content indexed by the |
| 444 | # Indexing API. |
| 445 | "predefinedSource": "A String", # Predefined content source for Google Apps. |
| 446 | }, |
| 447 | "resultCountExact": "A String", # The exact result count for this source. |
| 448 | }, |
| 449 | ], |
| 450 | }, |
| 451 | "facetResults": [ # Repeated facet results. |
| 452 | { # Source specific facet response |
| 453 | "buckets": [ # 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 | "count": 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 | "percentage": 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 | "value": { # Definition of a single value with generic type. |
| 467 | "integerValue": "A String", |
| 468 | "stringValue": "A String", |
| 469 | "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. |
| 470 | "month": 42, # Month of date. Must be from 1 to 12. |
| 471 | "day": 42, # Day of month. Must be from 1 to 31 and valid for the year and month. |
| 472 | "year": 42, # Year of date. Must be from 1 to 9999. |
| 473 | }, |
| 474 | "doubleValue": 3.14, |
| 475 | "timestampValue": "A String", |
| 476 | "booleanValue": True or False, |
| 477 | }, |
| 478 | }, |
| 479 | ], |
| 480 | "sourceName": "A String", # Source name for which facet results are returned. Will not be empty. |
| 481 | "operatorName": "A String", # Name of the operator chosen for faceting. @see |
| 482 | # cloudsearch.SchemaPropertyOptions |
| 483 | "objectType": "A String", # Object type for which facet results are returned. Can be empty. |
| 484 | }, |
| 485 | ], |
| 486 | "structuredResults": [ # 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 | "person": { # Object to represent a person. # Representation of a person |
| 490 | "obfuscatedId": "A String", # Obfuscated ID of a person. |
| 491 | "photos": [ # A person's read-only photo. A picture shown next to the person's name to |
| 492 | # help others recognize the person in search results. |
| 493 | { # A person's photo. |
| 494 | "url": "A String", # The URL of the photo. |
| 495 | }, |
| 496 | ], |
| 497 | "emailAddresses": [ # The person's email addresses |
| 498 | { # A person's email address. |
| 499 | "emailAddress": "A String", # The email address. |
| 500 | }, |
| 501 | ], |
| 502 | "personNames": [ # The person's name |
| 503 | { # A person's name. |
| 504 | "displayName": "A String", # The read-only display name formatted according to the locale specified by |
| 505 | # the viewer's account or the <code>Accept-Language</code> HTTP header. |
| 506 | }, |
| 507 | ], |
| 508 | "name": "A String", # The resource name of the person to provide information about. |
| 509 | # See <a href="https://developers.google.com/people/api/rest/v1/people/get"> |
| 510 | # People.get</a> from Google People API. |
| 511 | }, |
| 512 | }, |
| 513 | ], |
| 514 | "spellResults": [ # Suggested spelling for the query. |
| 515 | { |
| 516 | "suggestedQuery": "A String", # The suggested spelling of the query. |
| 517 | }, |
| 518 | ], |
| 519 | "resultCountExact": "A String", # The exact result count for this query. |
| 520 | "errorInfo": { # Error information about the response. # Error information about the response. |
| 521 | "errorMessages": [ |
| 522 | { # Error message per source response. |
| 523 | "errorMessage": "A String", |
| 524 | "source": { # Defines sources for the suggest/search APIs. |
| 525 | "name": "A String", # Source name for content indexed by the |
| 526 | # Indexing API. |
| 527 | "predefinedSource": "A String", # Predefined content source for Google Apps. |
| 528 | }, |
| 529 | }, |
| 530 | ], |
| 531 | }, |
| 532 | "hasMoreResults": True or False, # Whether there are more search results matching the query. |
| 533 | "queryInterpretation": { # Query interpretation result for user query. Empty if query interpretation |
| 534 | # is disabled. |
| 535 | "interpretationType": "A String", |
| 536 | "reason": "A String", # The reason for interpretation of the query. This field will not be |
| 537 | # UNSPECIFIED if the interpretation type is not NONE. |
| 538 | "interpretedQuery": "A String", # The interpretation of the query used in search. For example, queries with |
| 539 | # natural language intent like "email from john" will be interpreted as |
| 540 | # "from:john source:mail". 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. |
| 551 | A service account can't perform Query API requests directly; to use a |
| 552 | service account to perform queries, set up [G Suite domain-wide delegation |
| 553 | of |
| 554 | authority](https://developers.google.com/cloud-search/docs/guides/delegation/). |
| 555 | |
| 556 | Args: |
| 557 | body: object, The request body. |
| 558 | The object takes the form of: |
| 559 | |
| 560 | { # Request of suggest API. |
| 561 | "query": "A String", # Partial query for which autocomplete suggestions will be shown. |
| 562 | # For example, if the query is "sea", then the server might return |
| 563 | # "season", "search", "seagull" and so on. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 564 | "requestOptions": { # Shared request options for all RPC methods. # Request options, such as the search application and user timezone. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 565 | "searchApplicationId": "A String", # The ID generated when you create a search application using the |
| 566 | # [admin console](https://support.google.com/a/answer/9043922). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 567 | "languageCode": "A String", # The BCP-47 language code, such as "en-US" or "sr-Latn". |
| 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'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 | "timeZone": "A String", # Current user's time zone id, such as "America/Los_Angeles" or |
| 582 | # "Australia/Sydney". 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 | "debugOptions": { # Shared request debug options for all cloudsearch RPC methods. # Debug options of the request |
| 589 | "enableDebugging": True or False, # If you are asked by Google to help with debugging, set this field. |
| 590 | # Otherwise, ignore this field. |
| 591 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 592 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 593 | "dataSourceRestrictions": [ # The sources to use for suggestions. If not specified, the data sources |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 594 | # 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 Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 598 | { # Restriction on Datasource. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 599 | "filterOptions": [ # Filter options restricting the results. If multiple filters |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 600 | # 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 Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 607 | # "objecttype", "type" and "mimetype". |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 608 | # For now, schema specific filters cannot be used to filter suggestions. |
| 609 | { # Filter options to be applied on query. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 610 | "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'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 611 | # approaches: <br/><br/> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 612 | # **1. Setting a ValueFilter.** The name must match an operator_name defined in |
| 613 | # the schema for your data source. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 614 | # <br/> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 615 | # **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 Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 619 | "compositeFilter": { |
| 620 | "logicOperator": "A String", # The logic operator of the sub filter. |
| 621 | "subFilters": [ # Sub filters. |
| 622 | # Object with schema name: Filter |
| 623 | ], |
| 624 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 625 | "valueFilter": { |
| 626 | "operatorName": "A String", # The `operator_name` applied to the query, such as *price_greater_than*. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 627 | # The filter can work against both types of filters defined in the schema |
| 628 | # for your data source: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 629 | # <br/><br/> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 630 | # 1. `operator_name`, where the query filters results by the property |
| 631 | # that matches the value. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 632 | # <br/> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 633 | # 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 Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 636 | "value": { # Definition of a single value with generic type. # The value to be compared with. |
| 637 | "integerValue": "A String", |
| 638 | "stringValue": "A String", |
| 639 | "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 Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 640 | "month": 42, # Month of date. Must be from 1 to 12. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 641 | "day": 42, # Day of month. Must be from 1 to 31 and valid for the year and month. |
| 642 | "year": 42, # Year of date. Must be from 1 to 9999. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 643 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 644 | "doubleValue": 3.14, |
| 645 | "timestampValue": "A String", |
| 646 | "booleanValue": True or False, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 647 | }, |
| 648 | }, |
| 649 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 650 | "objectType": "A String", # If object_type is set, only objects of that type are returned. This should |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 651 | # 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 Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 655 | "source": { # Defines sources for the suggest/search APIs. # The source of restriction. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 656 | "name": "A String", # Source name for content indexed by the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 657 | # Indexing API. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 658 | "predefinedSource": "A String", # Predefined content source for Google Apps. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 659 | }, |
| 660 | }, |
| 661 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 662 | } |
| 663 | |
| 664 | x__xgafv: string, V1 error format. |
| 665 | Allowed values |
| 666 | 1 - v1 error format |
| 667 | 2 - v2 error format |
| 668 | |
| 669 | Returns: |
| 670 | An object of the form: |
| 671 | |
| 672 | { # Response of the suggest API. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 673 | "suggestResults": [ # List of suggestions. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 674 | { # One suggestion result. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 675 | "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 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 676 | # completion. |
| 677 | # indicator that the suggest result was a phrase completion. |
| 678 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 679 | "source": { # Defines sources for the suggest/search APIs. # The source of the suggestion. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 680 | "name": "A String", # Source name for content indexed by the |
| 681 | # Indexing API. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 682 | "predefinedSource": "A String", # Predefined content source for Google Apps. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 683 | }, |
| 684 | "suggestedQuery": "A String", # The suggested query that will be used for search, when the user |
| 685 | # clicks on the suggestion |
| 686 | "peopleSuggestion": { # 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 | "person": { # Object to represent a person. # Suggested person. All fields of the person object might not be populated. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 690 | "obfuscatedId": "A String", # Obfuscated ID of a person. |
| 691 | "photos": [ # A person's read-only photo. A picture shown next to the person's name to |
| 692 | # help others recognize the person in search results. |
| 693 | { # A person's photo. |
| 694 | "url": "A String", # The URL of the photo. |
| 695 | }, |
| 696 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 697 | "emailAddresses": [ # The person's email addresses |
| 698 | { # A person's email address. |
| 699 | "emailAddress": "A String", # The email address. |
| 700 | }, |
| 701 | ], |
| 702 | "personNames": [ # The person's name |
| 703 | { # A person's name. |
| 704 | "displayName": "A String", # The read-only display name formatted according to the locale specified by |
| 705 | # the viewer's account or the <code>Accept-Language</code> HTTP header. |
| 706 | }, |
| 707 | ], |
| 708 | "name": "A String", # The resource name of the person to provide information about. |
| 709 | # See <a href="https://developers.google.com/people/api/rest/v1/people/get"> |
| 710 | # People.get</a> from Google People API. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 711 | }, |
| 712 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 713 | }, |
| 714 | ], |
| 715 | }</pre> |
| 716 | </div> |
| 717 | |
| 718 | </body></html> |