Skip to content

Commit a3a42cc

Browse files
feat(specs): add specific documentation for facets query parameter in Composition API (generated)
algolia/api-clients-automation#5477 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Clara Muller <5667350+ClaraMuller@users.noreply.github.com>
1 parent 1ad1945 commit a3a42cc

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

Sources/Composition/Models/CompositionParams.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ public struct CompositionParams: Codable, JSONEncodable {
3131
/// `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas).
3232
/// Use this setting to strike a balance between the relevance and number of returned results.
3333
public var relevancyStrictness: Int?
34+
public var facetFilters: CompositionFacetFilters?
3435
/// Facets for which to retrieve facet values that match the search criteria and the number of matching facet values
35-
/// To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
36+
/// To retrieve all facets, use the wildcard character `*`. To retrieve disjunctive facets lists, annotate any
37+
/// facets with the `disjunctive` modifier. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts)
38+
/// and [disjunctive faceting for Smart Groups](https://www.algolia.com/doc/guides/managing-results/compositions/search-based-groups#facets-including-disjunctive-faceting).
3639
public var facets: [String]?
37-
public var facetFilters: CompositionFacetFilters?
3840
public var optionalFilters: CompositionOptionalFilters?
3941
public var numericFilters: CompositionNumericFilters?
4042
/// Number of hits per page.
@@ -101,8 +103,8 @@ public struct CompositionParams: Codable, JSONEncodable {
101103
page: Int? = nil,
102104
getRankingInfo: Bool? = nil,
103105
relevancyStrictness: Int? = nil,
104-
facets: [String]? = nil,
105106
facetFilters: CompositionFacetFilters? = nil,
107+
facets: [String]? = nil,
106108
optionalFilters: CompositionOptionalFilters? = nil,
107109
numericFilters: CompositionNumericFilters? = nil,
108110
hitsPerPage: Int? = nil,
@@ -130,8 +132,8 @@ public struct CompositionParams: Codable, JSONEncodable {
130132
self.page = page
131133
self.getRankingInfo = getRankingInfo
132134
self.relevancyStrictness = relevancyStrictness
133-
self.facets = facets
134135
self.facetFilters = facetFilters
136+
self.facets = facets
135137
self.optionalFilters = optionalFilters
136138
self.numericFilters = numericFilters
137139
self.hitsPerPage = hitsPerPage
@@ -161,8 +163,8 @@ public struct CompositionParams: Codable, JSONEncodable {
161163
case page
162164
case getRankingInfo
163165
case relevancyStrictness
164-
case facets
165166
case facetFilters
167+
case facets
166168
case optionalFilters
167169
case numericFilters
168170
case hitsPerPage
@@ -195,8 +197,8 @@ public struct CompositionParams: Codable, JSONEncodable {
195197
try container.encodeIfPresent(self.page, forKey: .page)
196198
try container.encodeIfPresent(self.getRankingInfo, forKey: .getRankingInfo)
197199
try container.encodeIfPresent(self.relevancyStrictness, forKey: .relevancyStrictness)
198-
try container.encodeIfPresent(self.facets, forKey: .facets)
199200
try container.encodeIfPresent(self.facetFilters, forKey: .facetFilters)
201+
try container.encodeIfPresent(self.facets, forKey: .facets)
200202
try container.encodeIfPresent(self.optionalFilters, forKey: .optionalFilters)
201203
try container.encodeIfPresent(self.numericFilters, forKey: .numericFilters)
202204
try container.encodeIfPresent(self.hitsPerPage, forKey: .hitsPerPage)
@@ -228,8 +230,8 @@ extension CompositionParams: Equatable {
228230
lhs.page == rhs.page &&
229231
lhs.getRankingInfo == rhs.getRankingInfo &&
230232
lhs.relevancyStrictness == rhs.relevancyStrictness &&
231-
lhs.facets == rhs.facets &&
232233
lhs.facetFilters == rhs.facetFilters &&
234+
lhs.facets == rhs.facets &&
233235
lhs.optionalFilters == rhs.optionalFilters &&
234236
lhs.numericFilters == rhs.numericFilters &&
235237
lhs.hitsPerPage == rhs.hitsPerPage &&
@@ -261,8 +263,8 @@ extension CompositionParams: Hashable {
261263
hasher.combine(self.page?.hashValue)
262264
hasher.combine(self.getRankingInfo?.hashValue)
263265
hasher.combine(self.relevancyStrictness?.hashValue)
264-
hasher.combine(self.facets?.hashValue)
265266
hasher.combine(self.facetFilters?.hashValue)
267+
hasher.combine(self.facets?.hashValue)
266268
hasher.combine(self.optionalFilters?.hashValue)
267269
hasher.combine(self.numericFilters?.hashValue)
268270
hasher.combine(self.hitsPerPage?.hashValue)

Sources/Composition/Models/MainInjectionQueryParameters.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ public struct MainInjectionQueryParameters: Codable, JSONEncodable {
176176
/// have the same facet values for the `attributeForDistinct`.
177177
public var facetingAfterDistinct: Bool?
178178
/// Facets for which to retrieve facet values that match the search criteria and the number of matching facet values
179-
/// To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
179+
/// To retrieve all facets, use the wildcard character `*`. To retrieve disjunctive facets lists, annotate any
180+
/// facets with the `disjunctive` modifier. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts)
181+
/// and [disjunctive faceting for Smart Groups](https://www.algolia.com/doc/guides/managing-results/compositions/search-based-groups#facets-including-disjunctive-faceting).
180182
public var facets: [String]?
181183
/// Number of hits per page.
182184
public var hitsPerPage: Int?

0 commit comments

Comments
 (0)