Skip to content

Commit c51e4c4

Browse files
committed
fix default behaviour
1 parent 8c72923 commit c51e4c4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/commonMain/kotlin/com/algolia/search/model/filter/FilterConverter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public sealed class FilterConverter<I : Filter, O> : (I) -> O {
2525
public object Legacy : FilterConverter<Filter, List<String>>() {
2626

2727
override fun invoke(filter: Filter): List<String> {
28-
return toLegacy(filter, escape = false)
28+
return toLegacy(filter, escape = true)
2929
}
3030

3131
/**
@@ -34,7 +34,7 @@ public sealed class FilterConverter<I : Filter, O> : (I) -> O {
3434
public object Unquoted : FilterConverter<Filter, List<String>>() {
3535

3636
override fun invoke(filter: Filter): List<String> {
37-
return toLegacy(filter, escape = true)
37+
return toLegacy(filter, escape = false)
3838
}
3939
}
4040

src/commonMain/kotlin/com/algolia/search/model/filter/FilterGroupsConverter.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ public sealed class FilterGroupsConverter<I, O> : (I) -> O {
4040
public sealed class Legacy<T : Filter> : FilterGroupsConverter<Set<FilterGroup<T>>, List<List<String>>>() {
4141

4242
override fun invoke(groups: Set<FilterGroup<T>>): List<List<String>> {
43-
return toLegacy(groups, escape = false)
43+
return toLegacy(groups, escape = true)
4444
}
4545

4646
/**
4747
* Same as [Legacy], but without quotes.
4848
*/
4949
@Suppress("FunctionName") // To keep DX consistency
5050
public fun Unquoted(groups: Set<FilterGroup<T>>): List<List<String>> {
51-
return toLegacy(groups, escape = true)
51+
return toLegacy(groups, escape = false)
5252
}
5353

5454
private fun toLegacy(groups: Set<FilterGroup<T>>, escape: Boolean): List<List<String>> {
@@ -60,7 +60,7 @@ public sealed class FilterGroupsConverter<I, O> : (I) -> O {
6060
}
6161

6262
private fun <T : Filter> convertFilter(filter: T, escape: Boolean): List<String> {
63-
return if (escape) FilterConverter.Legacy.Unquoted(filter) else FilterConverter.Legacy(filter)
63+
return if (escape) FilterConverter.Legacy(filter) else FilterConverter.Legacy.Unquoted(filter)
6464
}
6565

6666
object Facet : Legacy<Filter.Facet>()

0 commit comments

Comments
 (0)