Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
Ricerche di tendenza
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Ottenere le ricerche di tendenza
Per ottenere le ricerche di tendenza, chiama il metodo getTrendingSearches su ContextualSearchRuntime. Questo metodo accetta un singolo
GetTrendingSearchesOptions
in cui puoi specificare il numero massimo di tendenze restituite.
L'oggetto SearchSuggestions restituito non contiene proprietà accessibili. Contiene tutte le informazioni necessarie per il rendering delle ricerche di tendenza, ma per il resto è opaco.
Swift utilizza lo stile Swift Concurrency, mentre Objective-C utilizza una funzione di callback.
Objective-C
getTrendingSearchesWithOptions
[searchRuntime
getTrendingSearchesWithOptions:
[[GetTrendingSearchesOptions alloc] init]
completionHandler:^(SearchSuggestions *_Nullable suggestions,
NSError *_Nullable error) {
// error will be not null if there is an error.
// On success, suggestions will be non null.
}];
Display
Per visualizzare i chip delle ricerche di tendenza, utilizza lo stesso metodo
delle query di ricerca.
Avanti: Visualizzare i risultati di ricercaarrow_forward
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2026-05-13 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2026-05-13 UTC."],[],["To retrieve trending searches, use the `getTrendingSearches` method of `ContextualSearchRuntime`, providing `GetTrendingSearchesOptions` to set the maximum results. Swift employs async/await, while Objective-C utilizes a completion handler. The `SearchSuggestions` object returned is opaque, solely intended for rendering. Display trending search chips similarly to search suggestions using the method described in another page. Both languages provide the necessary tools to retrieve and handle trending search data.\n"]]