-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
SuggestParameters.cs
170 lines (156 loc) · 7.93 KB
/
SuggestParameters.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Azure.Search.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors.
/// </summary>
public partial class SuggestParameters
{
/// <summary>
/// Initializes a new instance of the SuggestParameters class.
/// </summary>
public SuggestParameters()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the SuggestParameters class.
/// </summary>
/// <param name="filter">An OData expression that filters the documents
/// considered for suggestions.</param>
/// <param name="useFuzzyMatching">A value indicating whether to use
/// fuzzy matching for the suggestions query. Default is false. When
/// set to true, the query will find terms even if there's a
/// substituted or missing character in the search text. While this
/// provides a better experience in some scenarios, it comes at a
/// performance cost as fuzzy suggestions queries are slower and
/// consume more resources.</param>
/// <param name="highlightPostTag">A string tag that is appended to hit
/// highlights. Must be set with highlightPreTag. If omitted, hit
/// highlighting of suggestions is disabled.</param>
/// <param name="highlightPreTag">A string tag that is prepended to hit
/// highlights. Must be set with highlightPostTag. If omitted, hit
/// highlighting of suggestions is disabled.</param>
/// <param name="minimumCoverage">A number between 0 and 100 indicating
/// the percentage of the index that must be covered by a suggestions
/// query in order for the query to be reported as a success. This
/// parameter can be useful for ensuring search availability even for
/// services with only one replica. The default is 80.</param>
/// <param name="orderBy">The list of OData $orderby expressions by
/// which to sort the results. Each expression can be either a field
/// name or a call to either the geo.distance() or the search.score()
/// functions. Each expression can be followed by asc to indicate
/// ascending, or desc to indicate descending. The default is ascending
/// order. Ties will be broken by the match scores of documents. If no
/// $orderby is specified, the default sort order is descending by
/// document match score. There can be at most 32 $orderby
/// clauses.</param>
/// <param name="searchFields">The list of field names to search for
/// the specified search text. Target fields must be included in the
/// specified suggester.</param>
/// <param name="select">The list of fields to retrieve. If
/// unspecified, only the key field will be included in the
/// results.</param>
/// <param name="top">The number of suggestions to retrieve. The value
/// must be a number between 1 and 100. The default is 5.</param>
public SuggestParameters(string filter = default(string), bool useFuzzyMatching = default(bool), string highlightPostTag = default(string), string highlightPreTag = default(string), double? minimumCoverage = default(double?), IList<string> orderBy = default(IList<string>), IList<string> searchFields = default(IList<string>), IList<string> select = default(IList<string>), int? top = default(int?))
{
Filter = filter;
UseFuzzyMatching = useFuzzyMatching;
HighlightPostTag = highlightPostTag;
HighlightPreTag = highlightPreTag;
MinimumCoverage = minimumCoverage;
OrderBy = orderBy;
SearchFields = searchFields;
Select = select;
Top = top;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets an OData expression that filters the documents
/// considered for suggestions.
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public string Filter { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to use fuzzy matching for
/// the suggestions query. Default is false. When set to true, the
/// query will find terms even if there's a substituted or missing
/// character in the search text. While this provides a better
/// experience in some scenarios, it comes at a performance cost as
/// fuzzy suggestions queries are slower and consume more resources.
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public bool UseFuzzyMatching { get; set; }
/// <summary>
/// Gets or sets a string tag that is appended to hit highlights. Must
/// be set with highlightPreTag. If omitted, hit highlighting of
/// suggestions is disabled.
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public string HighlightPostTag { get; set; }
/// <summary>
/// Gets or sets a string tag that is prepended to hit highlights. Must
/// be set with highlightPostTag. If omitted, hit highlighting of
/// suggestions is disabled.
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public string HighlightPreTag { get; set; }
/// <summary>
/// Gets or sets a number between 0 and 100 indicating the percentage
/// of the index that must be covered by a suggestions query in order
/// for the query to be reported as a success. This parameter can be
/// useful for ensuring search availability even for services with only
/// one replica. The default is 80.
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public double? MinimumCoverage { get; set; }
/// <summary>
/// Gets or sets the list of OData $orderby expressions by which to
/// sort the results. Each expression can be either a field name or a
/// call to either the geo.distance() or the search.score() functions.
/// Each expression can be followed by asc to indicate ascending, or
/// desc to indicate descending. The default is ascending order. Ties
/// will be broken by the match scores of documents. If no $orderby is
/// specified, the default sort order is descending by document match
/// score. There can be at most 32 $orderby clauses.
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public IList<string> OrderBy { get; set; }
/// <summary>
/// Gets or sets the list of field names to search for the specified
/// search text. Target fields must be included in the specified
/// suggester.
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public IList<string> SearchFields { get; set; }
/// <summary>
/// Gets or sets the list of fields to retrieve. If unspecified, only
/// the key field will be included in the results.
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public IList<string> Select { get; set; }
/// <summary>
/// Gets or sets the number of suggestions to retrieve. The value must
/// be a number between 1 and 100. The default is 5.
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public int? Top { get; set; }
}
}