| | 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 Microsoft.Rest; |
| | 14 | | using Newtonsoft.Json; |
| | 15 | | using System.Collections; |
| | 16 | | using System.Collections.Generic; |
| | 17 | | using System.Linq; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Matches single or multi-word synonyms in a token stream. This token |
| | 21 | | /// filter is implemented using Apache Lucene. |
| | 22 | | /// <see |
| | 23 | | /// href="http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/synonym/SynonymFilter.htm |
| | 24 | | /// /> |
| | 25 | | /// </summary> |
| | 26 | | [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.SynonymTokenFilter")] |
| | 27 | | public partial class SynonymTokenFilter : TokenFilter |
| | 28 | | { |
| | 29 | | /// <summary> |
| | 30 | | /// Initializes a new instance of the SynonymTokenFilter class. |
| | 31 | | /// </summary> |
| 4 | 32 | | public SynonymTokenFilter() |
| | 33 | | { |
| | 34 | | CustomInit(); |
| 4 | 35 | | } |
| | 36 | |
|
| | 37 | | /// <summary> |
| | 38 | | /// Initializes a new instance of the SynonymTokenFilter class. |
| | 39 | | /// </summary> |
| | 40 | | /// <param name="name">The name of the token filter. It must only |
| | 41 | | /// contain letters, digits, spaces, dashes or underscores, can only |
| | 42 | | /// start and end with alphanumeric characters, and is limited to 128 |
| | 43 | | /// characters.</param> |
| | 44 | | /// <param name="synonyms">A list of synonyms in following one of two |
| | 45 | | /// formats: 1. incredible, unbelievable, fabulous => amazing - all |
| | 46 | | /// terms on the left side of => symbol will be replaced with all |
| | 47 | | /// terms on its right side; 2. incredible, unbelievable, fabulous, |
| | 48 | | /// amazing - comma separated list of equivalent words. Set the expand |
| | 49 | | /// option to change how this list is interpreted.</param> |
| | 50 | | /// <param name="ignoreCase">A value indicating whether to case-fold |
| | 51 | | /// input for matching. Default is false.</param> |
| | 52 | | /// <param name="expand">A value indicating whether all words in the |
| | 53 | | /// list of synonyms (if => notation is not used) will map to one |
| | 54 | | /// another. If true, all words in the list of synonyms (if => |
| | 55 | | /// notation is not used) will map to one another. The following list: |
| | 56 | | /// incredible, unbelievable, fabulous, amazing is equivalent to: |
| | 57 | | /// incredible, unbelievable, fabulous, amazing => incredible, |
| | 58 | | /// unbelievable, fabulous, amazing. If false, the following list: |
| | 59 | | /// incredible, unbelievable, fabulous, amazing will be equivalent to: |
| | 60 | | /// incredible, unbelievable, fabulous, amazing => incredible. |
| | 61 | | /// Default is true.</param> |
| | 62 | | public SynonymTokenFilter(string name, IList<string> synonyms, bool? ignoreCase = default(bool?), bool? expand = |
| 6 | 63 | | : base(name) |
| | 64 | | { |
| 6 | 65 | | Synonyms = synonyms; |
| 6 | 66 | | IgnoreCase = ignoreCase; |
| 6 | 67 | | Expand = expand; |
| | 68 | | CustomInit(); |
| 6 | 69 | | } |
| | 70 | |
|
| | 71 | | /// <summary> |
| | 72 | | /// An initialization method that performs custom operations like setting defaults |
| | 73 | | /// </summary> |
| | 74 | | partial void CustomInit(); |
| | 75 | |
|
| | 76 | | /// <summary> |
| | 77 | | /// Gets or sets a list of synonyms in following one of two formats: 1. |
| | 78 | | /// incredible, unbelievable, fabulous =&gt; amazing - all terms on |
| | 79 | | /// the left side of =&gt; symbol will be replaced with all terms |
| | 80 | | /// on its right side; 2. incredible, unbelievable, fabulous, amazing - |
| | 81 | | /// comma separated list of equivalent words. Set the expand option to |
| | 82 | | /// change how this list is interpreted. |
| | 83 | | /// </summary> |
| | 84 | | [JsonProperty(PropertyName = "synonyms")] |
| 26 | 85 | | public IList<string> Synonyms { get; set; } |
| | 86 | |
|
| | 87 | | /// <summary> |
| | 88 | | /// Gets or sets a value indicating whether to case-fold input for |
| | 89 | | /// matching. Default is false. |
| | 90 | | /// </summary> |
| | 91 | | [JsonProperty(PropertyName = "ignoreCase")] |
| 22 | 92 | | public bool? IgnoreCase { get; set; } |
| | 93 | |
|
| | 94 | | /// <summary> |
| | 95 | | /// Gets or sets a value indicating whether all words in the list of |
| | 96 | | /// synonyms (if =&gt; notation is not used) will map to one |
| | 97 | | /// another. If true, all words in the list of synonyms (if =&gt; |
| | 98 | | /// notation is not used) will map to one another. The following list: |
| | 99 | | /// incredible, unbelievable, fabulous, amazing is equivalent to: |
| | 100 | | /// incredible, unbelievable, fabulous, amazing =&gt; incredible, |
| | 101 | | /// unbelievable, fabulous, amazing. If false, the following list: |
| | 102 | | /// incredible, unbelievable, fabulous, amazing will be equivalent to: |
| | 103 | | /// incredible, unbelievable, fabulous, amazing =&gt; incredible. |
| | 104 | | /// Default is true. |
| | 105 | | /// </summary> |
| | 106 | | [JsonProperty(PropertyName = "expand")] |
| 22 | 107 | | public bool? Expand { get; set; } |
| | 108 | |
|
| | 109 | | /// <summary> |
| | 110 | | /// Validate the object. |
| | 111 | | /// </summary> |
| | 112 | | /// <exception cref="ValidationException"> |
| | 113 | | /// Thrown if validation fails |
| | 114 | | /// </exception> |
| | 115 | | public override void Validate() |
| | 116 | | { |
| 4 | 117 | | base.Validate(); |
| 4 | 118 | | if (Synonyms == null) |
| | 119 | | { |
| 0 | 120 | | throw new ValidationException(ValidationRules.CannotBeNull, "Synonyms"); |
| | 121 | | } |
| 4 | 122 | | } |
| | 123 | | } |
| | 124 | | } |