| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using System.Collections.Generic; |
| | 6 | |
|
| | 7 | | namespace Azure.Search.Documents |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// Options for <see cref="SearchClient.GetDocumentAsync"/>. |
| | 11 | | /// </summary> |
| | 12 | | public class GetDocumentOptions |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// A list of field names to retrieve. Only fields marked as |
| | 16 | | /// retrievable can be included in this clause. Any field not |
| | 17 | | /// retrieved will be missing from the returned document. If empty, |
| | 18 | | /// all fields marked as retrievable in the schema are returned. |
| | 19 | | /// </summary> |
| 48 | 20 | | public IList<string> SelectedFields { get; internal set; } = new List<string>(); |
| | 21 | |
|
| | 22 | | /// <summary> |
| | 23 | | /// Gets the selected fields. If the collection is null or empty, we |
| | 24 | | /// return null. |
| | 25 | | /// </summary> |
| | 26 | | internal IEnumerable<string> SelectedFieldsOrNull => |
| 12 | 27 | | SelectedFields?.Count > 0 ? SelectedFields : null; |
| | 28 | | } |
| | 29 | | } |