सबसे ज़्यादा खोजे गए चैनल

ट्रेंडिंग वीडियो देखें

रुझान में चल रही खोजों के सुझाव पाने के लिए, ContextualSearchRuntime पर getTrendingSearches वाले तरीके को कॉल करें. इस तरीके में, एक GetTrendingSearchesOptions का इस्तेमाल किया जाता है. इसमें, रुझान में चल रही खोजों की ज़्यादा से ज़्यादा संख्या तय की जा सकती है.

दिखाए गए SearchSuggestions ऑब्जेक्ट में ऐसी कोई प्रॉपर्टी नहीं है जिसे ऐक्सेस किया जा सके. इसमें रुझान में चल रही खोजों को रेंडर करने के लिए सभी ज़रूरी जानकारी शामिल होती है, लेकिन जानकारी साफ़ नहीं होती है.

Swift, Swift Concurrency स्टाइल का इस्तेमाल करता है, जबकि Objective-C, कॉलबैक फ़ंक्शन का इस्तेमाल करता है.

Swift

getTrendingSearches(withOptions:)

Task {
    let suggestions = try await searchRuntime.getTrendingSearches(
            withOptions: GetTrendingSearchesOptions())
}

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.
                            }];

डिसप्ले

रुझान में चल रही खोजों के चिप दिखाने के लिए, खोज के सुझावों के लिए इस्तेमाल किए गए तरीके का इस्तेमाल करें.

अगला लेख: खोज के नतीजे दिखाना