File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed
commonMain/kotlin/com/algolia/search/serialize Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2,5 +2,5 @@ object Library: Dependency {
22
33 override val group = " com.algolia"
44 override val artifact = " algoliasearch-client-kotlin"
5- override val version = " 1.0.0-beta04 "
5+ override val version = " 1.0.0-beta05 "
66}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ object KSerializerFacetList : KSerializer<List<Facet>> {
1919 + json {
2020 KeyValue to it.value
2121 KeyCount to it.count
22+ it.highlightedOrNull?.let { KeyHighlighted to it }
2223 }
2324 }
2425 }
@@ -31,7 +32,8 @@ object KSerializerFacetList : KSerializer<List<Facet>> {
3132 return json.map {
3233 Facet (
3334 it.jsonObject.getPrimitive(KeyValue ).content,
34- it.jsonObject.getPrimitive(KeyCount ).int
35+ it.jsonObject.getPrimitive(KeyCount ).int,
36+ it.jsonObject.getPrimitiveOrNull(KeyHighlighted )?.content
3537 )
3638 }
3739 }
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ internal class TestResponseSearchForFacets : TestSerializer<ResponseSearchForFac
1616 override val items = listOf (
1717 ResponseSearchForFacets (
1818 facets = listOf (
19- Facet (unknown, 0 )
19+ Facet (unknown, 0 , " hello " )
2020 ),
2121 exhaustiveFacetsCount = true ,
2222 processingTimeMS = 0
@@ -25,6 +25,7 @@ internal class TestResponseSearchForFacets : TestSerializer<ResponseSearchForFac
2525 + json {
2626 KeyValue to unknown
2727 KeyCount to 0
28+ KeyHighlighted to " hello"
2829 }
2930 }
3031 KeyExhaustiveFacetsCount to true
Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ internal class TestSuiteSearch {
5959 search(Query (facets = allFacets, filters = " company:tesla" )).nbHits shouldEqual 1
6060 search(Query (facets = allFacets, filters = " (company:tesla OR company:spacex)" )).nbHits shouldEqual 2
6161 val query = FacetQuery (" a" )
62- val facetHits = searchForFacets(company, query).facets.map { it.value }
62+ val response = searchForFacets(company, query)
63+ val facetHits = response.facets.map { it.value }
6364
6465 facetHits shouldContain " Algolia"
6566 facetHits shouldContain " Amazon"
You can’t perform that action at this time.
0 commit comments