-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
SynonymMapsAttribute.cs
37 lines (34 loc) · 1.48 KB
/
SynonymMapsAttribute.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
using System;
using System.Collections.Generic;
using Microsoft.Azure.Search.Models;
namespace Microsoft.Azure.Search
{
/// <summary>
/// Indicates that the <see cref="Field"/> generated by <see cref="FieldBuilder"/> for
/// the target property should have its <see cref="Field.SynonymMaps"/> property set to the
/// specified value.
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public class SynonymMapsAttribute : Attribute
{
/// <summary>
/// Indicates that the specified synonym maps should be used for searches on the target field.
/// </summary>
/// <param name="synonymMaps">A list of synonym map names that associates synonym maps with the field.
/// This option can be used only with searchable fields. Currently only one synonym map per field is
/// supported. Assigning a synonym map to a field ensures that query terms targeting that field are
/// expanded at query-time using the rules in the synonym map.
/// </param>
public SynonymMapsAttribute(params string[] synonymMaps)
{
SynonymMaps = synonymMaps;
}
/// <summary>
/// A list of synonym map names that associates synonym maps with the field.
/// </summary>
public IList<string> SynonymMaps { get; }
}
}