| | 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 filtering, sorting, fuzzy matching, and other |
| | 18 | | /// suggestions query behaviors. |
| | 19 | | /// </summary> |
| | 20 | | internal partial class SuggestRequest |
| | 21 | | { |
| | 22 | | /// <summary> |
| | 23 | | /// Initializes a new instance of the SuggestRequest class. |
| | 24 | | /// </summary> |
| 42 | 25 | | public SuggestRequest() |
| | 26 | | { |
| | 27 | | CustomInit(); |
| 42 | 28 | | } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the SuggestRequest class. |
| | 32 | | /// </summary> |
| | 33 | | /// <param name="filter">An OData expression that filters the documents |
| | 34 | | /// considered for suggestions.</param> |
| | 35 | | /// <param name="useFuzzyMatching">A value indicating whether to use |
| | 36 | | /// fuzzy matching for the suggestion query. Default is false. When set |
| | 37 | | /// to true, the query will find suggestions even if there's a |
| | 38 | | /// substituted or missing character in the search text. While this |
| | 39 | | /// provides a better experience in some scenarios, it comes at a |
| | 40 | | /// performance cost as fuzzy suggestion searches are slower and |
| | 41 | | /// consume more resources.</param> |
| | 42 | | /// <param name="highlightPostTag">A string tag that is appended to hit |
| | 43 | | /// highlights. Must be set with highlightPreTag. If omitted, hit |
| | 44 | | /// highlighting of suggestions is disabled.</param> |
| | 45 | | /// <param name="highlightPreTag">A string tag that is prepended to hit |
| | 46 | | /// highlights. Must be set with highlightPostTag. If omitted, hit |
| | 47 | | /// highlighting of suggestions is disabled.</param> |
| | 48 | | /// <param name="minimumCoverage">A number between 0 and 100 indicating |
| | 49 | | /// the percentage of the index that must be covered by a suggestion |
| | 50 | | /// query in order for the query to be reported as a success. This |
| | 51 | | /// parameter can be useful for ensuring search availability even for |
| | 52 | | /// services with only one replica. The default is 80.</param> |
| | 53 | | /// <param name="orderBy">The comma-separated list of OData $orderby |
| | 54 | | /// expressions by which to sort the results. Each expression can be |
| | 55 | | /// either a field name or a call to either the geo.distance() or the |
| | 56 | | /// search.score() functions. Each expression can be followed by asc to |
| | 57 | | /// indicate ascending, or desc to indicate descending. The default is |
| | 58 | | /// ascending order. Ties will be broken by the match scores of |
| | 59 | | /// documents. If no $orderby is specified, the default sort order is |
| | 60 | | /// descending by document match score. There can be at most 32 |
| | 61 | | /// $orderby clauses.</param> |
| | 62 | | /// <param name="searchText">The search text to use to suggest |
| | 63 | | /// documents. Must be at least 1 character, and no more than 100 |
| | 64 | | /// characters.</param> |
| | 65 | | /// <param name="searchFields">The comma-separated list of field names |
| | 66 | | /// to search for the specified search text. Target fields must be |
| | 67 | | /// included in the specified suggester.</param> |
| | 68 | | /// <param name="select">The comma-separated list of fields to |
| | 69 | | /// retrieve. If unspecified, only the key field will be included in |
| | 70 | | /// the results.</param> |
| | 71 | | /// <param name="suggesterName">The name of the suggester as specified |
| | 72 | | /// in the suggesters collection that's part of the index |
| | 73 | | /// definition.</param> |
| | 74 | | /// <param name="top">The number of suggestions to retrieve. This must |
| | 75 | | /// be a value between 1 and 100. The default is 5.</param> |
| 0 | 76 | | public SuggestRequest(string filter = default(string), bool? useFuzzyMatching = default(bool?), string highlight |
| | 77 | | { |
| 0 | 78 | | Filter = filter; |
| 0 | 79 | | UseFuzzyMatching = useFuzzyMatching; |
| 0 | 80 | | HighlightPostTag = highlightPostTag; |
| 0 | 81 | | HighlightPreTag = highlightPreTag; |
| 0 | 82 | | MinimumCoverage = minimumCoverage; |
| 0 | 83 | | OrderBy = orderBy; |
| 0 | 84 | | SearchText = searchText; |
| 0 | 85 | | SearchFields = searchFields; |
| 0 | 86 | | Select = select; |
| 0 | 87 | | SuggesterName = suggesterName; |
| 0 | 88 | | Top = top; |
| | 89 | | CustomInit(); |
| 0 | 90 | | } |
| | 91 | |
|
| | 92 | | /// <summary> |
| | 93 | | /// An initialization method that performs custom operations like setting defaults |
| | 94 | | /// </summary> |
| | 95 | | partial void CustomInit(); |
| | 96 | |
|
| | 97 | | /// <summary> |
| | 98 | | /// Gets or sets an OData expression that filters the documents |
| | 99 | | /// considered for suggestions. |
| | 100 | | /// </summary> |
| | 101 | | [JsonProperty(PropertyName = "filter")] |
| 84 | 102 | | public string Filter { get; set; } |
| | 103 | |
|
| | 104 | | /// <summary> |
| | 105 | | /// Gets or sets a value indicating whether to use fuzzy matching for |
| | 106 | | /// the suggestion query. Default is false. When set to true, the query |
| | 107 | | /// will find suggestions even if there's a substituted or missing |
| | 108 | | /// character in the search text. While this provides a better |
| | 109 | | /// experience in some scenarios, it comes at a performance cost as |
| | 110 | | /// fuzzy suggestion searches are slower and consume more resources. |
| | 111 | | /// </summary> |
| | 112 | | [JsonProperty(PropertyName = "fuzzy")] |
| 84 | 113 | | public bool? UseFuzzyMatching { get; set; } |
| | 114 | |
|
| | 115 | | /// <summary> |
| | 116 | | /// Gets or sets a string tag that is appended to hit highlights. Must |
| | 117 | | /// be set with highlightPreTag. If omitted, hit highlighting of |
| | 118 | | /// suggestions is disabled. |
| | 119 | | /// </summary> |
| | 120 | | [JsonProperty(PropertyName = "highlightPostTag")] |
| 84 | 121 | | public string HighlightPostTag { get; set; } |
| | 122 | |
|
| | 123 | | /// <summary> |
| | 124 | | /// Gets or sets a string tag that is prepended to hit highlights. Must |
| | 125 | | /// be set with highlightPostTag. If omitted, hit highlighting of |
| | 126 | | /// suggestions is disabled. |
| | 127 | | /// </summary> |
| | 128 | | [JsonProperty(PropertyName = "highlightPreTag")] |
| 84 | 129 | | public string HighlightPreTag { get; set; } |
| | 130 | |
|
| | 131 | | /// <summary> |
| | 132 | | /// Gets or sets a number between 0 and 100 indicating the percentage |
| | 133 | | /// of the index that must be covered by a suggestion query in order |
| | 134 | | /// for the query to be reported as a success. This parameter can be |
| | 135 | | /// useful for ensuring search availability even for services with only |
| | 136 | | /// one replica. The default is 80. |
| | 137 | | /// </summary> |
| | 138 | | [JsonProperty(PropertyName = "minimumCoverage")] |
| 84 | 139 | | public double? MinimumCoverage { get; set; } |
| | 140 | |
|
| | 141 | | /// <summary> |
| | 142 | | /// Gets or sets the comma-separated list of OData $orderby expressions |
| | 143 | | /// by which to sort the results. Each expression can be either a field |
| | 144 | | /// name or a call to either the geo.distance() or the search.score() |
| | 145 | | /// functions. Each expression can be followed by asc to indicate |
| | 146 | | /// ascending, or desc to indicate descending. The default is ascending |
| | 147 | | /// order. Ties will be broken by the match scores of documents. If no |
| | 148 | | /// $orderby is specified, the default sort order is descending by |
| | 149 | | /// document match score. There can be at most 32 $orderby clauses. |
| | 150 | | /// </summary> |
| | 151 | | [JsonProperty(PropertyName = "orderby")] |
| 84 | 152 | | public string OrderBy { get; set; } |
| | 153 | |
|
| | 154 | | /// <summary> |
| | 155 | | /// Gets or sets the search text to use to suggest documents. Must be |
| | 156 | | /// at least 1 character, and no more than 100 characters. |
| | 157 | | /// </summary> |
| | 158 | | [JsonProperty(PropertyName = "search")] |
| 84 | 159 | | public string SearchText { get; set; } |
| | 160 | |
|
| | 161 | | /// <summary> |
| | 162 | | /// Gets or sets the comma-separated list of field names to search for |
| | 163 | | /// the specified search text. Target fields must be included in the |
| | 164 | | /// specified suggester. |
| | 165 | | /// </summary> |
| | 166 | | [JsonProperty(PropertyName = "searchFields")] |
| 84 | 167 | | public string SearchFields { get; set; } |
| | 168 | |
|
| | 169 | | /// <summary> |
| | 170 | | /// Gets or sets the comma-separated list of fields to retrieve. If |
| | 171 | | /// unspecified, only the key field will be included in the results. |
| | 172 | | /// </summary> |
| | 173 | | [JsonProperty(PropertyName = "select")] |
| 84 | 174 | | public string Select { get; set; } |
| | 175 | |
|
| | 176 | | /// <summary> |
| | 177 | | /// Gets or sets the name of the suggester as specified in the |
| | 178 | | /// suggesters collection that's part of the index definition. |
| | 179 | | /// </summary> |
| | 180 | | [JsonProperty(PropertyName = "suggesterName")] |
| 84 | 181 | | public string SuggesterName { get; set; } |
| | 182 | |
|
| | 183 | | /// <summary> |
| | 184 | | /// Gets or sets the number of suggestions to retrieve. This must be a |
| | 185 | | /// value between 1 and 100. The default is 5. |
| | 186 | | /// </summary> |
| | 187 | | [JsonProperty(PropertyName = "top")] |
| 84 | 188 | | public int? Top { get; set; } |
| | 189 | |
|
| | 190 | | } |
| | 191 | | } |