| | 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 | | /// Standard Apache Lucene analyzer; Composed of the standard tokenizer, |
| | 21 | | /// lowercase filter and stop filter. |
| | 22 | | /// <see |
| | 23 | | /// href="http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/StandardAnalyzer |
| | 24 | | /// /> |
| | 25 | | /// </summary> |
| | 26 | | [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.StandardAnalyzer")] |
| | 27 | | public partial class StandardAnalyzer : Analyzer |
| | 28 | | { |
| | 29 | | /// <summary> |
| | 30 | | /// Initializes a new instance of the StandardAnalyzer class. |
| | 31 | | /// </summary> |
| 4 | 32 | | public StandardAnalyzer() |
| | 33 | | { |
| | 34 | | CustomInit(); |
| 4 | 35 | | } |
| | 36 | |
|
| | 37 | | /// <summary> |
| | 38 | | /// Initializes a new instance of the StandardAnalyzer class. |
| | 39 | | /// </summary> |
| | 40 | | /// <param name="name">The name of the analyzer. It must only contain |
| | 41 | | /// letters, digits, spaces, dashes or underscores, can only start and |
| | 42 | | /// end with alphanumeric characters, and is limited to 128 |
| | 43 | | /// characters.</param> |
| | 44 | | /// <param name="maxTokenLength">The maximum token length. Default is |
| | 45 | | /// 255. Tokens longer than the maximum length are split. The maximum |
| | 46 | | /// token length that can be used is 300 characters.</param> |
| | 47 | | /// <param name="stopwords">A list of stopwords.</param> |
| | 48 | | public StandardAnalyzer(string name, int? maxTokenLength = default(int?), IList<string> stopwords = default(ILis |
| 6 | 49 | | : base(name) |
| | 50 | | { |
| 6 | 51 | | MaxTokenLength = maxTokenLength; |
| 6 | 52 | | Stopwords = stopwords; |
| | 53 | | CustomInit(); |
| 6 | 54 | | } |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// An initialization method that performs custom operations like setting defaults |
| | 58 | | /// </summary> |
| | 59 | | partial void CustomInit(); |
| | 60 | |
|
| | 61 | | /// <summary> |
| | 62 | | /// Gets or sets the maximum token length. Default is 255. Tokens |
| | 63 | | /// longer than the maximum length are split. The maximum token length |
| | 64 | | /// that can be used is 300 characters. |
| | 65 | | /// </summary> |
| | 66 | | [JsonProperty(PropertyName = "maxTokenLength")] |
| 26 | 67 | | public int? MaxTokenLength { get; set; } |
| | 68 | |
|
| | 69 | | /// <summary> |
| | 70 | | /// Gets or sets a list of stopwords. |
| | 71 | | /// </summary> |
| | 72 | | [JsonProperty(PropertyName = "stopwords")] |
| 22 | 73 | | public IList<string> Stopwords { get; set; } |
| | 74 | |
|
| | 75 | | /// <summary> |
| | 76 | | /// Validate the object. |
| | 77 | | /// </summary> |
| | 78 | | /// <exception cref="ValidationException"> |
| | 79 | | /// Thrown if validation fails |
| | 80 | | /// </exception> |
| | 81 | | public override void Validate() |
| | 82 | | { |
| 4 | 83 | | base.Validate(); |
| 4 | 84 | | if (MaxTokenLength > 300) |
| | 85 | | { |
| 0 | 86 | | throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxTokenLength", 300); |
| | 87 | | } |
| 4 | 88 | | } |
| | 89 | | } |
| | 90 | | } |