diff --git a/backend/src/main/java/com/storycove/service/SolrService.java b/backend/src/main/java/com/storycove/service/SolrService.java index a820c2c..e87aa04 100644 --- a/backend/src/main/java/com/storycove/service/SolrService.java +++ b/backend/src/main/java/com/storycove/service/SolrService.java @@ -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; diff --git a/solr/authors/conf/managed-schema b/solr/authors/conf/managed-schema index 15a57ec..bfa701e 100755 --- a/solr/authors/conf/managed-schema +++ b/solr/authors/conf/managed-schema @@ -71,7 +71,7 @@ - + diff --git a/solr/stories/conf/managed-schema b/solr/stories/conf/managed-schema index c0cfaab..21f220a 100755 --- a/solr/stories/conf/managed-schema +++ b/solr/stories/conf/managed-schema @@ -78,7 +78,7 @@ - +