solr migration button
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<field name="avatarImagePath" type="string" indexed="false" stored="true"/>
|
||||
|
||||
<!-- Multi-tenant Library Separation -->
|
||||
<field name="libraryId" type="string" indexed="true" stored="true" required="true"/>
|
||||
<field name="libraryId" type="string" indexed="true" stored="true" required="false" default="default"/>
|
||||
|
||||
<!-- Timestamp Fields -->
|
||||
<field name="createdAt" type="pdate" indexed="true" stored="true"/>
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<field name="volume" type="pint" indexed="true" stored="true"/>
|
||||
|
||||
<!-- Multi-tenant Library Separation -->
|
||||
<field name="libraryId" type="string" indexed="true" stored="true" required="true"/>
|
||||
<field name="libraryId" type="string" indexed="true" stored="true" required="false" default="default"/>
|
||||
|
||||
<!-- Reading Status Fields -->
|
||||
<field name="isRead" type="boolean" indexed="true" stored="true"/>
|
||||
|
||||
Reference in New Issue
Block a user