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 และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 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"]],["อัปเดตล่าสุด 2025-07-25 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"]]