solr migration button

This commit is contained in:
Stefan Hardegger
2025-09-23 14:57:16 +02:00
parent 6ee2d67027
commit 51a1a69b45
3 changed files with 18 additions and 6 deletions

View File

@@ -291,8 +291,14 @@ public class SolrService {
// Add library ID for multi-tenant separation
String currentLibraryId = getCurrentLibraryId();
if (currentLibraryId != null) {
doc.addField("libraryId", currentLibraryId);
try {
if (currentLibraryId != null) {
doc.addField("libraryId", currentLibraryId);
}
} catch (Exception e) {
// If libraryId field doesn't exist, log warning and continue without it
// This allows indexing to work even if schema migration hasn't completed
logger.warn("Could not add libraryId field to document (field may not exist in schema): {}", e.getMessage());
}
return doc;
@@ -330,8 +336,14 @@ public class SolrService {
// Add library ID for multi-tenant separation
String currentLibraryId = getCurrentLibraryId();
if (currentLibraryId != null) {
doc.addField("libraryId", currentLibraryId);
try {
if (currentLibraryId != null) {
doc.addField("libraryId", currentLibraryId);
}
} catch (Exception e) {
// If libraryId field doesn't exist, log warning and continue without it
// This allows indexing to work even if schema migration hasn't completed
logger.warn("Could not add libraryId field to document (field may not exist in schema): {}", e.getMessage());
}
return doc;