@@ -2120,7 +2120,8 @@ final class SearchClientSnippet {
2120
2120
rule: Rule (
2121
2121
objectID: " clearance-category-filter " ,
2122
2122
conditions: [ SearchCondition ( pattern: " " , anchoring: SearchAnchoring . `is`, context: " landing " ) ] ,
2123
- consequence: SearchConsequence ( params: SearchConsequenceParams ( optionalFilters: SearchOptionalFilters
2123
+ consequence: SearchConsequence ( params: SearchConsequenceParams (
2124
+ optionalFilters: SearchOptionalFilters
2124
2125
. string ( " clearance:true " )
2125
2126
) )
2126
2127
)
@@ -2166,7 +2167,8 @@ final class SearchClientSnippet {
2166
2167
rule: Rule (
2167
2168
objectID: " tomato-fruit " ,
2168
2169
conditions: [ SearchCondition ( pattern: " tomato " , anchoring: SearchAnchoring . contains) ] ,
2169
- consequence: SearchConsequence ( params: SearchConsequenceParams ( optionalFilters: SearchOptionalFilters
2170
+ consequence: SearchConsequence ( params: SearchConsequenceParams (
2171
+ optionalFilters: SearchOptionalFilters
2170
2172
. string ( " food_group:fruit " )
2171
2173
) )
2172
2174
)
@@ -2329,8 +2331,9 @@ final class SearchClientSnippet {
2329
2331
objectID: " color-facets " ,
2330
2332
conditions: [ SearchCondition ( pattern: " {facet:color} " ) ] ,
2331
2333
consequence: SearchConsequence (
2332
- params: SearchConsequenceParams ( automaticFacetFilters: SearchAutomaticFacetFilters
2333
- . arrayOfSearchAutomaticFacetFilter ( [ SearchAutomaticFacetFilter ( facet: " color " ) ] )
2334
+ params: SearchConsequenceParams (
2335
+ automaticFacetFilters: SearchAutomaticFacetFilters
2336
+ . arrayOfSearchAutomaticFacetFilter ( [ SearchAutomaticFacetFilter ( facet: " color " ) ] )
2334
2337
)
2335
2338
)
2336
2339
)
@@ -2535,7 +2538,8 @@ final class SearchClientSnippet {
2535
2538
objectID: " a-rule-id " ,
2536
2539
rule: Rule (
2537
2540
objectID: " a-rule-id " ,
2538
- consequence: SearchConsequence ( params: SearchConsequenceParams ( aroundRadius: SearchAroundRadius
2541
+ consequence: SearchConsequence ( params: SearchConsequenceParams (
2542
+ aroundRadius: SearchAroundRadius
2539
2543
. int ( 1000 )
2540
2544
) ) ,
2541
2545
validity: [ SearchTimeRange ( from: Int64 ( 1_577_836_800 ) , until: Int64 ( 1_577_836_800 ) ) ]
@@ -3602,7 +3606,8 @@ final class SearchClientSnippet {
3602
3606
let response : SearchResponse < Hit > = try await client. searchSingleIndex (
3603
3607
indexName: " <YOUR_INDEX_NAME> " ,
3604
3608
searchParams: SearchSearchParams
3605
- . searchSearchParamsObject ( SearchSearchParamsObject ( facetFilters: SearchFacetFilters
3609
+ . searchSearchParamsObject ( SearchSearchParamsObject (
3610
+ facetFilters: SearchFacetFilters
3606
3611
. arrayOfSearchFacetFilters ( [
3607
3612
SearchFacetFilters . string ( " publisher:Penguin " ) ,
3608
3613
SearchFacetFilters . arrayOfSearchFacetFilters ( [
@@ -3721,7 +3726,8 @@ final class SearchClientSnippet {
3721
3726
let response : SearchResponse < Hit > = try await client. searchSingleIndex (
3722
3727
indexName: " <YOUR_INDEX_NAME> " ,
3723
3728
searchParams: SearchSearchParams
3724
- . searchSearchParamsObject ( SearchSearchParamsObject ( facetFilters: SearchFacetFilters
3729
+ . searchSearchParamsObject ( SearchSearchParamsObject (
3730
+ facetFilters: SearchFacetFilters
3725
3731
. string ( " category:-Ebook " )
3726
3732
) )
3727
3733
)
@@ -3871,7 +3877,8 @@ final class SearchClientSnippet {
3871
3877
let response : SearchResponse < Hit > = try await client. searchSingleIndex (
3872
3878
indexName: " <YOUR_INDEX_NAME> " ,
3873
3879
searchParams: SearchSearchParams
3874
- . searchSearchParamsObject ( SearchSearchParamsObject ( insideBoundingBox: SearchInsideBoundingBox
3880
+ . searchSearchParamsObject ( SearchSearchParamsObject (
3881
+ insideBoundingBox: SearchInsideBoundingBox
3875
3882
. arrayOfArrayOfDouble ( [ [
3876
3883
49.067996905313834 ,
3877
3884
65.73828125 ,
@@ -3956,7 +3963,8 @@ final class SearchClientSnippet {
3956
3963
let response : SearchResponse < Hit > = try await client. searchSingleIndex (
3957
3964
indexName: " <YOUR_INDEX_NAME> " ,
3958
3965
searchParams: SearchSearchParams
3959
- . searchSearchParamsObject ( SearchSearchParamsObject ( optionalFilters: SearchOptionalFilters
3966
+ . searchSearchParamsObject ( SearchSearchParamsObject (
3967
+ optionalFilters: SearchOptionalFilters
3960
3968
. arrayOfSearchOptionalFilters ( [ SearchOptionalFilters . string ( " can_deliver_quickly:true " ) ] )
3961
3969
) )
3962
3970
)
@@ -3976,7 +3984,8 @@ final class SearchClientSnippet {
3976
3984
let response : SearchResponse < Hit > = try await client. searchSingleIndex (
3977
3985
indexName: " <YOUR_INDEX_NAME> " ,
3978
3986
searchParams: SearchSearchParams
3979
- . searchSearchParamsObject ( SearchSearchParamsObject ( optionalFilters: SearchOptionalFilters
3987
+ . searchSearchParamsObject ( SearchSearchParamsObject (
3988
+ optionalFilters: SearchOptionalFilters
3980
3989
. arrayOfSearchOptionalFilters ( [
3981
3990
SearchOptionalFilters . string ( " brand:Apple<score=3> " ) ,
3982
3991
SearchOptionalFilters . string ( " brand:Samsung<score=2> " ) ,
@@ -4000,7 +4009,8 @@ final class SearchClientSnippet {
4000
4009
let response : SearchResponse < Hit > = try await client. searchSingleIndex (
4001
4010
indexName: " <YOUR_INDEX_NAME> " ,
4002
4011
searchParams: SearchSearchParams
4003
- . searchSearchParamsObject ( SearchSearchParamsObject ( optionalFilters: SearchOptionalFilters
4012
+ . searchSearchParamsObject ( SearchSearchParamsObject (
4013
+ optionalFilters: SearchOptionalFilters
4004
4014
. arrayOfSearchOptionalFilters ( [
4005
4015
SearchOptionalFilters . string ( " brand:Apple<score=2> " ) ,
4006
4016
SearchOptionalFilters . string ( " type:tablet " ) ,
@@ -4170,7 +4180,8 @@ final class SearchClientSnippet {
4170
4180
let response : SearchResponse < Hit > = try await client. searchSingleIndex (
4171
4181
indexName: " <YOUR_INDEX_NAME> " ,
4172
4182
searchParams: SearchSearchParams
4173
- . searchSearchParamsObject ( SearchSearchParamsObject ( facetFilters: SearchFacetFilters
4183
+ . searchSearchParamsObject ( SearchSearchParamsObject (
4184
+ facetFilters: SearchFacetFilters
4174
4185
. arrayOfSearchFacetFilters ( [
4175
4186
SearchFacetFilters . string ( " user:user42 " ) ,
4176
4187
SearchFacetFilters . string ( " user:public " ) ,
@@ -6180,8 +6191,9 @@ final class SearchClientSnippet {
6180
6191
// Call the API
6181
6192
let response = try await client. setSettings (
6182
6193
indexName: " <YOUR_INDEX_NAME> " ,
6183
- indexSettings: IndexSettings ( typoTolerance: SearchTypoTolerance
6184
- . searchTypoToleranceEnum ( SearchTypoToleranceEnum . min)
6194
+ indexSettings: IndexSettings (
6195
+ typoTolerance: SearchTypoTolerance
6196
+ . searchTypoToleranceEnum ( SearchTypoToleranceEnum . min)
6185
6197
) ,
6186
6198
forwardToReplicas: true
6187
6199
)
@@ -6218,8 +6230,9 @@ final class SearchClientSnippet {
6218
6230
// Call the API
6219
6231
let response = try await client. setSettings (
6220
6232
indexName: " <YOUR_INDEX_NAME> " ,
6221
- indexSettings: IndexSettings ( ignorePlurals: SearchIgnorePlurals
6222
- . arrayOfSearchSupportedLanguage ( [ SearchSupportedLanguage . fr] )
6233
+ indexSettings: IndexSettings (
6234
+ ignorePlurals: SearchIgnorePlurals
6235
+ . arrayOfSearchSupportedLanguage ( [ SearchSupportedLanguage . fr] )
6223
6236
) ,
6224
6237
forwardToReplicas: true
6225
6238
)
@@ -6256,8 +6269,9 @@ final class SearchClientSnippet {
6256
6269
// Call the API
6257
6270
let response = try await client. setSettings (
6258
6271
indexName: " <YOUR_INDEX_NAME> " ,
6259
- indexSettings: IndexSettings ( removeStopWords: SearchRemoveStopWords
6260
- . arrayOfSearchSupportedLanguage ( [ SearchSupportedLanguage . fr] )
6272
+ indexSettings: IndexSettings (
6273
+ removeStopWords: SearchRemoveStopWords
6274
+ . arrayOfSearchSupportedLanguage ( [ SearchSupportedLanguage . fr] )
6261
6275
) ,
6262
6276
forwardToReplicas: true
6263
6277
)
0 commit comments