| | 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 Newtonsoft.Json; |
| | 14 | | using System.Linq; |
| | 15 | |
|
| | 16 | | /// <summary> |
| | 17 | | /// Parameters for fuzzy matching, and other autocomplete query behaviors. |
| | 18 | | /// </summary> |
| | 19 | | internal partial class AutocompleteRequest |
| | 20 | | { |
| | 21 | | /// <summary> |
| | 22 | | /// Initializes a new instance of the AutocompleteRequest class. |
| | 23 | | /// </summary> |
| 38 | 24 | | public AutocompleteRequest() |
| | 25 | | { |
| | 26 | | CustomInit(); |
| 38 | 27 | | } |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// Initializes a new instance of the AutocompleteRequest class. |
| | 31 | | /// </summary> |
| | 32 | | /// <param name="searchText">The search text on which to base |
| | 33 | | /// autocomplete results.</param> |
| | 34 | | /// <param name="autocompleteMode">Specifies the mode for Autocomplete. |
| | 35 | | /// The default is 'oneTerm'. Use 'twoTerms' to get shingles and |
| | 36 | | /// 'oneTermWithContext' to use the current context while producing |
| | 37 | | /// auto-completed terms. Possible values include: 'oneTerm', |
| | 38 | | /// 'twoTerms', 'oneTermWithContext'</param> |
| | 39 | | /// <param name="filter">An OData expression that filters the documents |
| | 40 | | /// used to produce completed terms for the Autocomplete |
| | 41 | | /// result.</param> |
| | 42 | | /// <param name="useFuzzyMatching">A value indicating whether to use |
| | 43 | | /// fuzzy matching for the autocomplete query. Default is false. When |
| | 44 | | /// set to true, the query will autocomplete terms even if there's a |
| | 45 | | /// substituted or missing character in the search text. While this |
| | 46 | | /// provides a better experience in some scenarios, it comes at a |
| | 47 | | /// performance cost as fuzzy autocomplete queries are slower and |
| | 48 | | /// consume more resources.</param> |
| | 49 | | /// <param name="highlightPostTag">A string tag that is appended to hit |
| | 50 | | /// highlights. Must be set with highlightPreTag. If omitted, hit |
| | 51 | | /// highlighting is disabled.</param> |
| | 52 | | /// <param name="highlightPreTag">A string tag that is prepended to hit |
| | 53 | | /// highlights. Must be set with highlightPostTag. If omitted, hit |
| | 54 | | /// highlighting is disabled.</param> |
| | 55 | | /// <param name="minimumCoverage">A number between 0 and 100 indicating |
| | 56 | | /// the percentage of the index that must be covered by an autocomplete |
| | 57 | | /// query in order for the query to be reported as a success. This |
| | 58 | | /// parameter can be useful for ensuring search availability even for |
| | 59 | | /// services with only one replica. The default is 80.</param> |
| | 60 | | /// <param name="searchFields">The comma-separated list of field names |
| | 61 | | /// to consider when querying for auto-completed terms. Target fields |
| | 62 | | /// must be included in the specified suggester.</param> |
| | 63 | | /// <param name="suggesterName">The name of the suggester as specified |
| | 64 | | /// in the suggesters collection that's part of the index |
| | 65 | | /// definition.</param> |
| | 66 | | /// <param name="top">The number of auto-completed terms to retrieve. |
| | 67 | | /// This must be a value between 1 and 100. The default is 5.</param> |
| 0 | 68 | | public AutocompleteRequest(string searchText = default(string), AutocompleteMode? autocompleteMode = default(Aut |
| | 69 | | { |
| 0 | 70 | | SearchText = searchText; |
| 0 | 71 | | AutocompleteMode = autocompleteMode; |
| 0 | 72 | | Filter = filter; |
| 0 | 73 | | UseFuzzyMatching = useFuzzyMatching; |
| 0 | 74 | | HighlightPostTag = highlightPostTag; |
| 0 | 75 | | HighlightPreTag = highlightPreTag; |
| 0 | 76 | | MinimumCoverage = minimumCoverage; |
| 0 | 77 | | SearchFields = searchFields; |
| 0 | 78 | | SuggesterName = suggesterName; |
| 0 | 79 | | Top = top; |
| | 80 | | CustomInit(); |
| 0 | 81 | | } |
| | 82 | |
|
| | 83 | | /// <summary> |
| | 84 | | /// An initialization method that performs custom operations like setting defaults |
| | 85 | | /// </summary> |
| | 86 | | partial void CustomInit(); |
| | 87 | |
|
| | 88 | | /// <summary> |
| | 89 | | /// Gets or sets the search text on which to base autocomplete results. |
| | 90 | | /// </summary> |
| | 91 | | [JsonProperty(PropertyName = "search")] |
| 76 | 92 | | public string SearchText { get; set; } |
| | 93 | |
|
| | 94 | | /// <summary> |
| | 95 | | /// Gets or sets specifies the mode for Autocomplete. The default is |
| | 96 | | /// 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' |
| | 97 | | /// to use the current context while producing auto-completed terms. |
| | 98 | | /// Possible values include: 'oneTerm', 'twoTerms', |
| | 99 | | /// 'oneTermWithContext' |
| | 100 | | /// </summary> |
| | 101 | | [JsonProperty(PropertyName = "autocompleteMode")] |
| 76 | 102 | | public AutocompleteMode? AutocompleteMode { get; set; } |
| | 103 | |
|
| | 104 | | /// <summary> |
| | 105 | | /// Gets or sets an OData expression that filters the documents used to |
| | 106 | | /// produce completed terms for the Autocomplete result. |
| | 107 | | /// </summary> |
| | 108 | | [JsonProperty(PropertyName = "filter")] |
| 76 | 109 | | public string Filter { get; set; } |
| | 110 | |
|
| | 111 | | /// <summary> |
| | 112 | | /// Gets or sets a value indicating whether to use fuzzy matching for |
| | 113 | | /// the autocomplete query. Default is false. When set to true, the |
| | 114 | | /// query will autocomplete terms even if there's a substituted or |
| | 115 | | /// missing character in the search text. While this provides a better |
| | 116 | | /// experience in some scenarios, it comes at a performance cost as |
| | 117 | | /// fuzzy autocomplete queries are slower and consume more resources. |
| | 118 | | /// </summary> |
| | 119 | | [JsonProperty(PropertyName = "fuzzy")] |
| 76 | 120 | | public bool? UseFuzzyMatching { get; set; } |
| | 121 | |
|
| | 122 | | /// <summary> |
| | 123 | | /// Gets or sets a string tag that is appended to hit highlights. Must |
| | 124 | | /// be set with highlightPreTag. If omitted, hit highlighting is |
| | 125 | | /// disabled. |
| | 126 | | /// </summary> |
| | 127 | | [JsonProperty(PropertyName = "highlightPostTag")] |
| 76 | 128 | | public string HighlightPostTag { get; set; } |
| | 129 | |
|
| | 130 | | /// <summary> |
| | 131 | | /// Gets or sets a string tag that is prepended to hit highlights. Must |
| | 132 | | /// be set with highlightPostTag. If omitted, hit highlighting is |
| | 133 | | /// disabled. |
| | 134 | | /// </summary> |
| | 135 | | [JsonProperty(PropertyName = "highlightPreTag")] |
| 76 | 136 | | public string HighlightPreTag { get; set; } |
| | 137 | |
|
| | 138 | | /// <summary> |
| | 139 | | /// Gets or sets a number between 0 and 100 indicating the percentage |
| | 140 | | /// of the index that must be covered by an autocomplete query in order |
| | 141 | | /// for the query to be reported as a success. This parameter can be |
| | 142 | | /// useful for ensuring search availability even for services with only |
| | 143 | | /// one replica. The default is 80. |
| | 144 | | /// </summary> |
| | 145 | | [JsonProperty(PropertyName = "minimumCoverage")] |
| 76 | 146 | | public double? MinimumCoverage { get; set; } |
| | 147 | |
|
| | 148 | | /// <summary> |
| | 149 | | /// Gets or sets the comma-separated list of field names to consider |
| | 150 | | /// when querying for auto-completed terms. Target fields must be |
| | 151 | | /// included in the specified suggester. |
| | 152 | | /// </summary> |
| | 153 | | [JsonProperty(PropertyName = "searchFields")] |
| 76 | 154 | | public string SearchFields { get; set; } |
| | 155 | |
|
| | 156 | | /// <summary> |
| | 157 | | /// Gets or sets the name of the suggester as specified in the |
| | 158 | | /// suggesters collection that's part of the index definition. |
| | 159 | | /// </summary> |
| | 160 | | [JsonProperty(PropertyName = "suggesterName")] |
| 76 | 161 | | public string SuggesterName { get; set; } |
| | 162 | |
|
| | 163 | | /// <summary> |
| | 164 | | /// Gets or sets the number of auto-completed terms to retrieve. This |
| | 165 | | /// must be a value between 1 and 100. The default is 5. |
| | 166 | | /// </summary> |
| | 167 | | [JsonProperty(PropertyName = "top")] |
| 76 | 168 | | public int? Top { get; set; } |
| | 169 | |
|
| | 170 | | } |
| | 171 | | } |