| | 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 System.Collections.Generic; |
| | 7 | | using Microsoft.Azure.Search.Models; |
| | 8 | |
|
| | 9 | | namespace Microsoft.Azure.Search |
| | 10 | | { |
| | 11 | | /// <summary> |
| | 12 | | /// Indicates that the <see cref="Field"/> generated by <see cref="FieldBuilder"/> for |
| | 13 | | /// the target property should have its <see cref="Field.SynonymMaps"/> property set to the |
| | 14 | | /// specified value. |
| | 15 | | /// </summary> |
| | 16 | | [AttributeUsage(AttributeTargets.Property)] |
| | 17 | | public class SynonymMapsAttribute : Attribute |
| | 18 | | { |
| | 19 | | /// <summary> |
| | 20 | | /// Indicates that the specified synonym maps should be used for searches on the target field. |
| | 21 | | /// </summary> |
| | 22 | | /// <param name="synonymMaps">A list of synonym map names that associates synonym maps with the field. |
| | 23 | | /// This option can be used only with searchable fields. Currently only one synonym map per field is |
| | 24 | | /// supported. Assigning a synonym map to a field ensures that query terms targeting that field are |
| | 25 | | /// expanded at query-time using the rules in the synonym map. |
| | 26 | | /// </param> |
| 5320 | 27 | | public SynonymMapsAttribute(params string[] synonymMaps) |
| | 28 | | { |
| 5320 | 29 | | SynonymMaps = synonymMaps; |
| 5320 | 30 | | } |
| | 31 | |
|
| | 32 | | /// <summary> |
| | 33 | | /// A list of synonym map names that associates synonym maps with the field. |
| | 34 | | /// </summary> |
| 760 | 35 | | public IList<string> SynonymMaps { get; } |
| | 36 | | } |
| | 37 | | } |