| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System.Collections; |
| | 9 | | using System.Collections.Generic; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.Search.Documents.Models |
| | 13 | | { |
| | 14 | | /// <summary> Contains a document found by a search query, plus associated metadata. </summary> |
| | 15 | | internal partial class SearchResult : IReadOnlyDictionary<string, object> |
| | 16 | | { |
| | 17 | | /// <summary> Initializes a new instance of SearchResult. </summary> |
| | 18 | | /// <param name="score"> The relevance score of the document compared to other documents returned by the query. |
| 0 | 19 | | internal SearchResult(double score) |
| | 20 | | { |
| 0 | 21 | | Score = score; |
| 0 | 22 | | Highlights = new ChangeTrackingDictionary<string, IList<string>>(); |
| 0 | 23 | | AdditionalProperties = new ChangeTrackingDictionary<string, object>(); |
| 0 | 24 | | } |
| | 25 | |
|
| | 26 | | /// <summary> Initializes a new instance of SearchResult. </summary> |
| | 27 | | /// <param name="score"> The relevance score of the document compared to other documents returned by the query. |
| | 28 | | /// <param name="highlights"> Text fragments from the document that indicate the matching search terms, organize |
| | 29 | | /// <param name="additionalProperties"> . </param> |
| 0 | 30 | | internal SearchResult(double score, IReadOnlyDictionary<string, IList<string>> highlights, IReadOnlyDictionary<s |
| | 31 | | { |
| 0 | 32 | | Score = score; |
| 0 | 33 | | Highlights = highlights; |
| 0 | 34 | | AdditionalProperties = additionalProperties; |
| 0 | 35 | | } |
| | 36 | |
|
| | 37 | | /// <summary> The relevance score of the document compared to other documents returned by the query. </summary> |
| 0 | 38 | | public double Score { get; } |
| | 39 | | /// <summary> Text fragments from the document that indicate the matching search terms, organized by each applic |
| 0 | 40 | | public IReadOnlyDictionary<string, IList<string>> Highlights { get; } |
| 0 | 41 | | internal IReadOnlyDictionary<string, object> AdditionalProperties { get; } |
| | 42 | | /// <inheritdoc /> |
| 0 | 43 | | public IEnumerator<KeyValuePair<string, object>> GetEnumerator() => AdditionalProperties.GetEnumerator(); |
| | 44 | | /// <inheritdoc /> |
| 0 | 45 | | IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator(); |
| | 46 | | /// <inheritdoc /> |
| 0 | 47 | | public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value); |
| | 48 | | /// <inheritdoc /> |
| 0 | 49 | | public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key); |
| | 50 | | /// <inheritdoc /> |
| 0 | 51 | | public IEnumerable<string> Keys => AdditionalProperties.Keys; |
| | 52 | | /// <inheritdoc /> |
| 0 | 53 | | public IEnumerable<object> Values => AdditionalProperties.Values; |
| | 54 | | /// <inheritdoc /> |
| 0 | 55 | | int IReadOnlyCollection<KeyValuePair<string, object>>.Count => AdditionalProperties.Count; |
| | 56 | | /// <inheritdoc /> |
| | 57 | | public object this[string key] |
| | 58 | | { |
| 0 | 59 | | get => AdditionalProperties[key]; |
| | 60 | | } |
| | 61 | | } |
| | 62 | | } |