Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
การค้นหาที่มาแรง
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
รับการค้นหาที่มาแรง
หากต้องการรับการค้นหาที่มาแรง ให้เรียกใช้เมธอด getTrendingSearches ใน ContextualSearchRuntime เมธอดนี้ใช้
GetTrendingSearchesOptions
รายการเดียว ซึ่งคุณสามารถระบุจำนวนสูงสุดของการค้นหาที่มาแรงที่จะแสดงได้
ออบเจ็กต์ SearchSuggestions ที่แสดงผลจะไม่มีพร็อพเพอร์ตี้ที่เข้าถึงได้ โดยจะมีข้อมูลที่จำเป็นทั้งหมดในการแสดงผลการค้นหาที่มาแรง แต่จะไม่มีข้อมูลอื่นๆ
Swift ใช้สไตล์การทำงานพร้อมกันของ Swift ส่วน Objective-C ใช้ฟังก์ชัน 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.
}];
ดิสเพลย์
หากต้องการแสดงชิปการค้นหาที่มาแรง ให้ใช้วิธีเดียวกับคำแนะนำในการค้นหา
ถัดไป: แสดงผลการค้นหาarrow_forward
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2026-05-13 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 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"]]