Struct SearchResult
Encapsulate an element that was retrieved from a query in a g.
Namespace: UnityEditor.Search
Syntax
public readonly struct SearchResult : IEquatable<SearchResult>, IComparable<SearchResult>
Constructors
SearchResult(Int32)
Create a new SearchResult
Declaration
public SearchResult(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the document containing that result. |
SearchResult(Int32, Int32)
Create a new SearchResult
Declaration
public SearchResult(int index, int score)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the document containing that result. |
Int32 | score | Score of the result. Higher means it is a more relevant result. |
SearchResult(String, Int32, Int32)
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. |
Int32 | index | Index of the document containing that result. |
Int32 | 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 |
---|---|
Int32 |
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 |
---|---|
Int32 |
Properties
valid
Checks if a search result is valid.
Declaration
public readonly bool valid { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
CompareTo(SearchResult)
Compare Search Result using their index value.
Declaration
public readonly int CompareTo(SearchResult other)
Parameters
Type | Name | Description |
---|---|---|
SearchResult | other | Another SearchResult to compare. |
Returns
Type | Description |
---|---|
Int32 | Returns true if both SearchResult have the same index. |
Equals(Object)
Compare Search Result using their index value.
Declaration
public override readonly bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
Object | other | Another SearchResult to compare. |
Returns
Type | Description |
---|---|
Boolean | Returns true if both SearchResult have the same index. |
Overrides
Equals(SearchResult)
Compare Search Result using their index value.
Declaration
public readonly bool Equals(SearchResult other)
Parameters
Type | Name | Description |
---|---|---|
SearchResult | other | Another SearchResult to compare. |
Returns
Type | Description |
---|---|
Boolean | Returns true if both SearchResult have the same index. |
GetHashCode()
Compute the hash code for this SearchResult from its index property.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
ToString()
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
String |