Struct SearchResult
Encapsulate an element that was retrieved from a query in a g.
Inherited Members
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
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 |