| | | 1 | | // <auto-generated> |
| | | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | | 4 | | // license information. |
| | | 5 | | // |
| | | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | | 8 | | // regenerated. |
| | | 9 | | // </auto-generated> |
| | | 10 | | |
| | | 11 | | namespace Microsoft.Azure.Search.Models |
| | | 12 | | { |
| | | 13 | | using Newtonsoft.Json; |
| | | 14 | | using System.Collections; |
| | | 15 | | using System.Collections.Generic; |
| | | 16 | | using System.Linq; |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Contains a document found by a search query, plus associated metadata. |
| | | 20 | | /// </summary> |
| | | 21 | | public partial class SearchResult<T> |
| | | 22 | | { |
| | | 23 | | /// <summary> |
| | | 24 | | /// Initializes a new instance of the SearchResult class. |
| | | 25 | | /// </summary> |
| | 0 | 26 | | public SearchResult() |
| | | 27 | | { |
| | | 28 | | CustomInit(); |
| | 0 | 29 | | } |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// Initializes a new instance of the SearchResult class. |
| | | 33 | | /// </summary> |
| | | 34 | | /// <param name="document">The document found by the search query.</param> |
| | | 35 | | /// <param name="score">The relevance score of the document compared to |
| | | 36 | | /// other documents returned by the query.</param> |
| | | 37 | | /// <param name="highlights">Text fragments from the document that |
| | | 38 | | /// indicate the matching search terms, organized by each applicable |
| | | 39 | | /// field; null if hit highlighting was not enabled for the |
| | | 40 | | /// query.</param> |
| | 25134 | 41 | | public SearchResult(T document = default(T), double score = default(double), IDictionary<string, IList<string>> |
| | | 42 | | { |
| | 25134 | 43 | | Document = document; |
| | 25134 | 44 | | Score = score; |
| | 25134 | 45 | | Highlights = highlights; |
| | | 46 | | CustomInit(); |
| | 25134 | 47 | | } |
| | | 48 | | |
| | | 49 | | /// <summary> |
| | | 50 | | /// An initialization method that performs custom operations like setting defaults |
| | | 51 | | /// </summary> |
| | | 52 | | partial void CustomInit(); |
| | | 53 | | |
| | | 54 | | /// <summary> |
| | | 55 | | /// Gets the document found by the search query. |
| | | 56 | | /// </summary> |
| | 42520 | 57 | | public T Document { get; private set; } |
| | | 58 | | |
| | | 59 | | /// <summary> |
| | | 60 | | /// Gets the relevance score of the document compared to other |
| | | 61 | | /// documents returned by the query. |
| | | 62 | | /// </summary> |
| | | 63 | | [JsonProperty(PropertyName = "@search.score")] |
| | 25222 | 64 | | public double Score { get; private set; } |
| | | 65 | | |
| | | 66 | | /// <summary> |
| | | 67 | | /// Gets text fragments from the document that indicate the matching |
| | | 68 | | /// search terms, organized by each applicable field; null if hit |
| | | 69 | | /// highlighting was not enabled for the query. |
| | | 70 | | /// </summary> |
| | | 71 | | [JsonProperty(PropertyName = "@search.highlights")] |
| | 25218 | 72 | | public IDictionary<string, IList<string>> Highlights { get; private set; } |
| | | 73 | | |
| | | 74 | | } |
| | | 75 | | } |