@@ -25,16 +25,29 @@ namespace MongoDB.Driver.Search
25
25
public sealed class SearchMetaCountResult
26
26
{
27
27
/// <summary>
28
- /// Gets or sets the lower bound for this result set .
28
+ /// Initializes a new instance of the <see cref="SearchMetaCountResult"/> class .
29
29
/// </summary>
30
+ /// <param name="lowerBound">Lower bound for this result set.</param>
31
+ /// <param name="total">Total for this result set.</param>
32
+ public SearchMetaCountResult ( long ? lowerBound , long ? total )
33
+ {
34
+ LowerBound = lowerBound ;
35
+ Total = total ;
36
+ }
37
+
38
+ /// <summary>
39
+ /// Gets the lower bound for this result set.
40
+ /// </summary>
41
+ [ BsonDefaultValue ( null ) ]
30
42
[ BsonElement ( "lowerBound" ) ]
31
- public long ? LowerBound { get ; private set ; }
43
+ public long ? LowerBound { get ; }
32
44
33
45
/// <summary>
34
- /// Gets or sets the total for this result set.
46
+ /// Gets the total for this result set.
35
47
/// </summary>
48
+ [ BsonDefaultValue ( null ) ]
36
49
[ BsonElement ( "total" ) ]
37
- public long ? Total { get ; private set ; }
50
+ public long ? Total { get ; }
38
51
}
39
52
40
53
/// <summary>
@@ -43,16 +56,27 @@ public sealed class SearchMetaCountResult
43
56
public sealed class SearchMetaFacetBucketResult
44
57
{
45
58
/// <summary>
46
- /// Gets or sets the count of documents in this facet bucket.
59
+ /// Initializes a new instance of the <see cref="SearchMetaFacetBucketResult"/> class.
60
+ /// </summary>
61
+ /// <param name="count">count of documents in this facet bucket.</param>
62
+ /// <param name="id">Unique identifier that identifies this facet bucket.</param>
63
+ public SearchMetaFacetBucketResult ( long count , BsonValue id )
64
+ {
65
+ Count = count ;
66
+ Id = id ;
67
+ }
68
+
69
+ /// <summary>
70
+ /// Gets the count of documents in this facet bucket.
47
71
/// </summary>
48
72
[ BsonElement ( "count" ) ]
49
- public long Count { get ; private set ; }
73
+ public long Count { get ; }
50
74
51
75
/// <summary>
52
- /// Gets or sets the unique identifier that identifies this facet bucket.
76
+ /// Gets the unique identifier that identifies this facet bucket.
53
77
/// </summary>
54
78
[ BsonId ]
55
- public BsonValue Id { get ; private set ; }
79
+ public BsonValue Id { get ; }
56
80
}
57
81
58
82
/// <summary>
@@ -61,10 +85,19 @@ public sealed class SearchMetaFacetBucketResult
61
85
public sealed class SearchMetaFacetResult
62
86
{
63
87
/// <summary>
64
- /// Gets or sets a list of bucket result sets.
88
+ /// Initializes a new instance of the <see cref="SearchMetaFacetResult"/> class.
89
+ /// </summary>
90
+ /// <param name="buckets">An array of bucket result sets.</param>
91
+ public SearchMetaFacetResult ( SearchMetaFacetBucketResult [ ] buckets )
92
+ {
93
+ Buckets = buckets ;
94
+ }
95
+
96
+ /// <summary>
97
+ /// Gets an array of bucket result sets.
65
98
/// </summary>
66
99
[ BsonElement ( "buckets" ) ]
67
- public List < SearchMetaFacetBucketResult > Buckets { get ; private set ; }
100
+ public SearchMetaFacetBucketResult [ ] Buckets { get ; }
68
101
}
69
102
70
103
/// <summary>
@@ -73,15 +106,28 @@ public sealed class SearchMetaFacetResult
73
106
public sealed class SearchMetaResult
74
107
{
75
108
/// <summary>
76
- /// Gets or sets the count result set.
109
+ /// Initializes a new instance of the <see cref="SearchMetaResult"/> class.
110
+ /// </summary>
111
+ /// <param name="count">Count result set.</param>
112
+ /// <param name="facet">Facet result sets.</param>
113
+ public SearchMetaResult ( SearchMetaCountResult count , IReadOnlyDictionary < string , SearchMetaFacetResult > facet )
114
+ {
115
+ Count = count ;
116
+ Facet = facet ;
117
+ }
118
+
119
+ /// <summary>
120
+ /// Gets the count result set.
77
121
/// </summary>
122
+ [ BsonDefaultValue ( null ) ]
78
123
[ BsonElement ( "count" ) ]
79
- public SearchMetaCountResult Count { get ; private set ; }
124
+ public SearchMetaCountResult Count { get ; }
80
125
81
126
/// <summary>
82
- /// Gets or sets the facet result sets.
127
+ /// Gets the facet result sets.
83
128
/// </summary>
129
+ [ BsonDefaultValue ( null ) ]
84
130
[ BsonElement ( "facet" ) ]
85
- public Dictionary < string , SearchMetaFacetResult > Facet { get ; private set ; }
131
+ public IReadOnlyDictionary < string , SearchMetaFacetResult > Facet { get ; }
86
132
}
87
133
}
0 commit comments