Skip to content

Commit 49a9337

Browse files
authored
Merge pull request #194 from algolia/feat/appliedRules
feat(search): add appliedRules as part of the ResponseSearch
2 parents b381de3 + c0aef60 commit 49a9337

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/commonMain/kotlin/com/algolia/search/model/response/ResponseSearch.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import com.algolia.search.serialize.JsonNonStrict
2121
import com.algolia.search.serialize.KSerializerFacetMap
2222
import com.algolia.search.serialize.KSerializerPoint
2323
import com.algolia.search.serialize.KeyAbTestVariantID
24+
import com.algolia.search.serialize.KeyAppliedRules
2425
import com.algolia.search.serialize.KeyAroundLatLng
2526
import com.algolia.search.serialize.KeyAutomaticRadius
2627
import com.algolia.search.serialize.KeyCursor
@@ -211,7 +212,11 @@ public data class ResponseSearch(
211212
/**
212213
* Meta-information as to how the query was processed.
213214
*/
214-
@SerialName(KeyExplain) val explainOrNull: Explain? = null
215+
@SerialName(KeyExplain) val explainOrNull: Explain? = null,
216+
/**
217+
* The rules applied to the query.
218+
*/
219+
@SerialName(KeyAppliedRules) val appliedRulesOrNull: List<JsonObject>? = null
215220
) {
216221

217222
public val hits: List<Hit>
@@ -304,6 +309,9 @@ public data class ResponseSearch(
304309
public val explain: Explain
305310
get() = explainOrNull!!
306311

312+
public val appliedRules: List<JsonObject>
313+
get() = appliedRulesOrNull!!
314+
307315
@Deprecated(
308316
message = "Use getObjectPosition instead.",
309317
replaceWith = ReplaceWith("getObjectPosition(objectID)"),

src/commonMain/kotlin/com/algolia/search/serialize/KeysTwo.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,4 @@ public const val KeyUser_Token = "user_token"
198198
public const val KeyPersonalization = "personalization"
199199
public const val KeyRankingScore = "rankingScore"
200200
public const val KeyFiltersScore = "filtersScore"
201+
public const val KeyAppliedRules = "appliedRules"

0 commit comments

Comments
 (0)