From d3ea98d498fee72a3e1fe0b3a9f74688a0a3654d Mon Sep 17 00:00:00 2001 From: Alexander Eliseyev Date: Wed, 30 Aug 2017 21:06:16 +0700 Subject: [PATCH] Non-string ids for Algolia records deletion fix --- .../elasticsearch/dataimport/AlgoliaDataImportHandler.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/uy/kohesive/elasticsearch/dataimport/AlgoliaDataImportHandler.kt b/src/main/kotlin/uy/kohesive/elasticsearch/dataimport/AlgoliaDataImportHandler.kt index a58ef1a..69dada7 100644 --- a/src/main/kotlin/uy/kohesive/elasticsearch/dataimport/AlgoliaDataImportHandler.kt +++ b/src/main/kotlin/uy/kohesive/elasticsearch/dataimport/AlgoliaDataImportHandler.kt @@ -152,7 +152,7 @@ class AlgoliaObjectsDeleteTask(schema: StructType, serializedSettings: String) : if (idField == null) { throw IllegalStateException("Delete statement must have `idField` defined") } - targetIndex.deleteObjects(objects.map { it[idField] as? String }.filterNotNull()) + targetIndex.deleteObjects(objects.map { it[idField]?.toString() }.filterNotNull()) } }