Table of Contents

Class SearchResult

Namespace
Examine
Assembly
Examine.Core.dll

Represents a search result

public class SearchResult : ISearchResult
Inheritance
SearchResult
Implements
Derived
Inherited Members

Constructors

SearchResult(string, float, Func<IDictionary<string, List<string>>>)

Constructor

public SearchResult(string id, float score, Func<IDictionary<string, List<string>>> lazyFieldVals)

Parameters

id string
score float
lazyFieldVals Func<IDictionary<string, List<string>>>

Properties

AllValues

Returns the values in the result

public IReadOnlyDictionary<string, IReadOnlyList<string>> AllValues { get; }

Property Value

IReadOnlyDictionary<string, IReadOnlyList<string>>

Remarks

This is used to retrieve multiple values per field if there are any

Id

The id of the search result

public string Id { get; }

Property Value

string

this[int]

Returns the key value pair for the index specified

public KeyValuePair<string, string> this[int resultIndex] { get; }

Parameters

resultIndex int

Property Value

KeyValuePair<string, string>

this[string]

Returns the value for the key specified

public string? this[string key] { get; }

Parameters

key string

Property Value

string

Score

The score of the search result

public float Score { get; }

Property Value

float

Values

Returns the values in the result

public IReadOnlyDictionary<string, string> Values { get; }

Property Value

IReadOnlyDictionary<string, string>

Methods

Equals(object?)

Override this method so that the Distinct() operator works

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

Override this method so that the Distinct() operator works

public override int GetHashCode()

Returns

int

GetValues(string)

If a single field was indexed with multiple values this will return those values, otherwise it will just return the single value stored for that field. If the field is not found it returns an empty collection.

public IEnumerable<string> GetValues(string key)

Parameters

key string

Returns

IEnumerable<string>