| | 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 | | /// Construct bigrams for frequently occurring terms while indexing. Single |
| | 21 | | /// terms are still indexed too, with bigrams overlaid. This token filter |
| | 22 | | /// is implemented using Apache Lucene. |
| | 23 | | /// <see |
| | 24 | | /// href="http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/commongrams/CommonGramsFi |
| | 25 | | /// /> |
| | 26 | | /// </summary> |
| | 27 | | [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.CommonGramTokenFilter")] |
| | 28 | | public partial class CommonGramTokenFilter : TokenFilter |
| | 29 | | { |
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the CommonGramTokenFilter class. |
| | 32 | | /// </summary> |
| 4 | 33 | | public CommonGramTokenFilter() |
| | 34 | | { |
| | 35 | | CustomInit(); |
| 4 | 36 | | } |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Initializes a new instance of the CommonGramTokenFilter class. |
| | 40 | | /// </summary> |
| | 41 | | /// <param name="name">The name of the token filter. It must only |
| | 42 | | /// contain letters, digits, spaces, dashes or underscores, can only |
| | 43 | | /// start and end with alphanumeric characters, and is limited to 128 |
| | 44 | | /// characters.</param> |
| | 45 | | /// <param name="commonWords">The set of common words.</param> |
| | 46 | | /// <param name="ignoreCase">A value indicating whether common words |
| | 47 | | /// matching will be case insensitive. Default is false.</param> |
| | 48 | | /// <param name="useQueryMode">A value that indicates whether the token |
| | 49 | | /// filter is in query mode. When in query mode, the token filter |
| | 50 | | /// generates bigrams and then removes common words and single terms |
| | 51 | | /// followed by a common word. Default is false.</param> |
| | 52 | | public CommonGramTokenFilter(string name, IList<string> commonWords, bool? ignoreCase = default(bool?), bool? us |
| 4 | 53 | | : base(name) |
| | 54 | | { |
| 4 | 55 | | CommonWords = commonWords; |
| 4 | 56 | | IgnoreCase = ignoreCase; |
| 4 | 57 | | UseQueryMode = useQueryMode; |
| | 58 | | CustomInit(); |
| 4 | 59 | | } |
| | 60 | |
|
| | 61 | | /// <summary> |
| | 62 | | /// An initialization method that performs custom operations like setting defaults |
| | 63 | | /// </summary> |
| | 64 | | partial void CustomInit(); |
| | 65 | |
|
| | 66 | | /// <summary> |
| | 67 | | /// Gets or sets the set of common words. |
| | 68 | | /// </summary> |
| | 69 | | [JsonProperty(PropertyName = "commonWords")] |
| 24 | 70 | | public IList<string> CommonWords { get; set; } |
| | 71 | |
|
| | 72 | | /// <summary> |
| | 73 | | /// Gets or sets a value indicating whether common words matching will |
| | 74 | | /// be case insensitive. Default is false. |
| | 75 | | /// </summary> |
| | 76 | | [JsonProperty(PropertyName = "ignoreCase")] |
| 20 | 77 | | public bool? IgnoreCase { get; set; } |
| | 78 | |
|
| | 79 | | /// <summary> |
| | 80 | | /// Gets or sets a value that indicates whether the token filter is in |
| | 81 | | /// query mode. When in query mode, the token filter generates bigrams |
| | 82 | | /// and then removes common words and single terms followed by a common |
| | 83 | | /// word. Default is false. |
| | 84 | | /// </summary> |
| | 85 | | [JsonProperty(PropertyName = "queryMode")] |
| 20 | 86 | | public bool? UseQueryMode { get; set; } |
| | 87 | |
|
| | 88 | | /// <summary> |
| | 89 | | /// Validate the object. |
| | 90 | | /// </summary> |
| | 91 | | /// <exception cref="ValidationException"> |
| | 92 | | /// Thrown if validation fails |
| | 93 | | /// </exception> |
| | 94 | | public override void Validate() |
| | 95 | | { |
| 4 | 96 | | base.Validate(); |
| 4 | 97 | | if (CommonWords == null) |
| | 98 | | { |
| 0 | 99 | | throw new ValidationException(ValidationRules.CannotBeNull, "CommonWords"); |
| | 100 | | } |
| 4 | 101 | | } |
| | 102 | | } |
| | 103 | | } |