Class AsyncSearchSession | Quick Search | 1.4.2-preview.3
docs.unity3d.com
    Show / Hide Table of Contents

    Class AsyncSearchSession

    An async search session tracks all incoming items found by search provider that weren't returned right away after the search was initiated.

    Inheritance
    Object
    AsyncSearchSession
    Namespace: Unity.QuickSearch
    Syntax
    public class AsyncSearchSession

    Properties

    SearchInProgress

    Checks if there is any active async search sessions.

    Declaration
    public static bool SearchInProgress { get; }
    Property Value
    Type Description
    Boolean

    Methods

    FetchSome(List<SearchItem>, Int32, Boolean)

    Request to fetch new async search results.

    Declaration
    public bool FetchSome(List<SearchItem> items, int quantity, bool doNotCountNull)
    Parameters
    Type Name Description
    List<SearchItem> items

    The list of items to append new results to.

    Int32 quantity

    The maximum amount of items to be added to @items

    Boolean doNotCountNull

    Ignore all yield return null results.

    Returns
    Type Description
    Boolean

    Returns true if there is still some results to fetch later or false if we've fetched everything remaining.

    FetchSome(List<SearchItem>, Int32, Boolean, Int64)

    Request to fetch new async search results.

    Declaration
    public bool FetchSome(List<SearchItem> items, int quantity, bool doNotCountNull, long maxFetchTimeMs)
    Parameters
    Type Name Description
    List<SearchItem> items

    The list of items to append new results to.

    Int32 quantity

    The maximum amount of items to add to @items

    Boolean doNotCountNull

    Ignore all yield return null results.

    Int64 maxFetchTimeMs

    The amount of time allowed to yield new results.

    Returns
    Type Description
    Boolean

    Returns true if there is still some results to fetch later or false if we've fetched everything remaining.

    FetchSome(List<SearchItem>, Int64)

    Request to fetch new async search results.

    Declaration
    public bool FetchSome(List<SearchItem> items, long maxFetchTimeMs)
    Parameters
    Type Name Description
    List<SearchItem> items

    The list of items to append new results to.

    Int64 maxFetchTimeMs

    The amount of time allowed to yield new results.

    Returns
    Type Description
    Boolean

    Returns true if there is still some results to fetch later or false if we've fetched everything remaining.

    OnUpdate()

    Called when the system is ready to process any new async results.

    Declaration
    public void OnUpdate()

    Reset(IEnumerator<SearchItem>, Int64)

    Hard reset an async search session.

    Declaration
    public void Reset(IEnumerator<SearchItem> itemEnumerator, long maxFetchTimePerProviderMs = 10L)
    Parameters
    Type Name Description
    IEnumerator<SearchItem> itemEnumerator

    The enumerator that will yield new search results.

    Int64 maxFetchTimePerProviderMs

    The amount of time allowed to yield new results.

    Remarks

    Normally async search sessions are re-used per search provider.

    Stop()

    Stop the async search session and discard any new search results.

    Declaration
    public void Stop()

    Events

    asyncItemReceived

    This event is used to receive any async search result.

    Declaration
    public static event Action<IEnumerable<SearchItem>> asyncItemReceived
    Event Type
    Type Description
    Action<IEnumerable<SearchItem>>
    Remarks

    It is usually used by a search view to append additional search results to a UI list.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023