diff --git a/libsearch/index/ai-indexer.cpp b/libsearch/index/ai-indexer.cpp index 17d156e..8abed40 100644 --- a/libsearch/index/ai-indexer.cpp +++ b/libsearch/index/ai-indexer.cpp @@ -95,7 +95,13 @@ bool AiIndexer::addTextFileIndex(const QJsonArray &object) if(!AiIndexerPrivate::m_sessionValid) { return false; } - return data_management_add_text_files(AiIndexerPrivate::m_session, QJsonDocument(object).toJson().data()) == DataManagementResult::DATA_MANAGEMENT_SUCCESS; + DataManagementResult result = data_management_add_text_files(AiIndexerPrivate::m_session, QJsonDocument(object).toJson().data()); + if(result != DataManagementResult::DATA_MANAGEMENT_SUCCESS) { + qWarning() << "Fail to call data_management_add_text_files, input: " << QJsonDocument(object).toJson().data() + << "result:" << result; + return false; + } + return true; } bool AiIndexer::addImageFileIndex(const QJsonArray &object) @@ -103,7 +109,13 @@ bool AiIndexer::addImageFileIndex(const QJsonArray &object) if(!AiIndexerPrivate::m_sessionValid) { return false; } - return data_management_add_image_files(AiIndexerPrivate::m_session, QJsonDocument(object).toJson().data()) == DataManagementResult::DATA_MANAGEMENT_SUCCESS; + DataManagementResult result = data_management_add_image_files(AiIndexerPrivate::m_session, QJsonDocument(object).toJson().data()); + if(result != DataManagementResult::DATA_MANAGEMENT_SUCCESS) { + qWarning() << "Fail to call data_management_add_image_files, input: " << QJsonDocument(object).toJson().data() + << "result:" << result; + return false; + } + return true; } bool AiIndexer::deleteFileIndex(const QStringList &files) diff --git a/libsearch/index/index-updater.cpp b/libsearch/index/index-updater.cpp index cc9f6a5..2b67257 100644 --- a/libsearch/index/index-updater.cpp +++ b/libsearch/index/index-updater.cpp @@ -230,13 +230,11 @@ void IndexUpdater::updateAiIndex() return; } qDebug() << "| index:" <