Struct SearchResult
Encapsulate an element that was retrieved from a query in a g.
Namespace: Unity.QuickSearch
Syntax
public 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 |
score
Score of the result. Higher means it is a more relevant result.
Declaration
public readonly int score
Field Value
Type | Description |
---|---|
Int32 |
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 |
---|---|
Int32 | 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 |
---|---|
Boolean | 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 |
---|---|
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 int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |