| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 3 | | // license information. |
| | 4 | |
|
| | 5 | | using System; |
| | 6 | | using Microsoft.Azure.Search.Models; |
| | 7 | |
|
| | 8 | | namespace Microsoft.Azure.Search |
| | 9 | | { |
| | 10 | | /// <summary> |
| | 11 | | /// Indicates whether the field can be returned in a search result. This |
| | 12 | | /// defaults to true, so this attribute only has any effect if you use it |
| | 13 | | /// as [IsRetrievable(false)]. |
| | 14 | | /// </summary> |
| | 15 | | [AttributeUsage(AttributeTargets.Property)] |
| | 16 | | public class IsRetrievableAttribute : Attribute |
| | 17 | | { |
| | 18 | | /// <summary> |
| | 19 | | /// Indicates that the specified value should be used for the <c cref="Field.IsRetrievable">IsRetrievable</c> |
| | 20 | | /// flag of the target field. |
| | 21 | | /// </summary> |
| | 22 | | /// <param name="isRetrievable"><c>true</c> if the target field should be included in |
| | 23 | | /// search results, <c>false</c> otherwise.</param> |
| 6840 | 24 | | public IsRetrievableAttribute(bool isRetrievable) |
| | 25 | | { |
| 6840 | 26 | | IsRetrievable = isRetrievable; |
| 6840 | 27 | | } |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// <c>true</c> if the target field should be included in search results, <c>false</c> otherwise. |
| | 31 | | /// </summary> |
| 1520 | 32 | | public bool IsRetrievable { get; } |
| | 33 | | } |
| | 34 | | } |