docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct SearchResult

    Encapsulate an element that was retrieved from a query in a g.

    Implements
    IEquatable<SearchResult>
    IComparable<SearchResult>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEditor.Search
    Assembly: com.unity.quicksearch.dll
    Syntax
    public readonly struct SearchResult : IEquatable<SearchResult>, IComparable<SearchResult>

    Constructors

    SearchResult(int)

    Create a new SearchResult

    Declaration
    public SearchResult(int index)
    Parameters
    Type Name Description
    int index

    Index of the document containing that result.

    SearchResult(int, int)

    Create a new SearchResult

    Declaration
    public SearchResult(int index, int score)
    Parameters
    Type Name Description
    int index

    Index of the document containing that result.

    int score

    Score of the result. Higher means it is a more relevant result.

    SearchResult(string, int, int)

    Create a new SearchResult

    Declaration
    public SearchResult(string id, int index, int score)
    Parameters
    Type Name Description
    string id

    Id of the document containing that result.

    int index

    Index of the document containing that result.

    int score

    Score of the result. Higher means it is a more relevant result.

    Fields

    id

    Id of the document containing that result.

    Declaration
    public readonly string id
    Field Value
    Type Description
    string

    index

    Index of the document containing that result.

    Declaration
    public readonly int index
    Field Value
    Type Description
    int

    nil

    Represents a null search result.

    Declaration
    public static readonly SearchResult nil
    Field Value
    Type Description
    SearchResult

    score

    Score of the result. Higher means it is a more relevant result.

    Declaration
    public readonly int score
    Field Value
    Type Description
    int

    Properties

    valid

    Checks if a search result is valid.

    Declaration
    public bool valid { get; }
    Property Value
    Type Description
    bool

    Methods

    CompareTo(SearchResult)

    Compare Search Result using their index value.

    Declaration
    public int CompareTo(SearchResult other)
    Parameters
    Type Name Description
    SearchResult other

    Another SearchResult to compare.

    Returns
    Type Description
    int

    Returns true if both SearchResult have the same index.

    Equals(object)

    Compare Search Result using their index value.

    Declaration
    public override bool Equals(object other)
    Parameters
    Type Name Description
    object other

    Another SearchResult to compare.

    Returns
    Type Description
    bool

    Returns true if both SearchResult have the same index.

    Overrides
    ValueType.Equals(object)

    Equals(SearchResult)

    Compare Search Result using their index value.

    Declaration
    public bool Equals(SearchResult other)
    Parameters
    Type Name Description
    SearchResult other

    Another SearchResult to compare.

    Returns
    Type Description
    bool

    Returns true if both SearchResult have the same index.

    GetHashCode()

    Compute the hash code for this SearchResult from its index property.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    ValueType.GetHashCode()

    Implements

    IEquatable<T>
    IComparable<T>
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)