Skip to content

Commit

Permalink
Fix copy field duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Aug 15, 2023
1 parent 154df64 commit 12cc445
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ public void init() {
try {
SchemaRequest.AddField addFieldRequest = new SchemaRequest.AddField(fieldAttributes);
addFieldRequest.process(solrClient, COLLECTION);
} catch (Exception e) {
logger.debug("Failed to add field", e);
}

if (indexed.copyTo().length > 0) {
try {
SchemaRequest.AddCopyField addCopyFieldRequest = new SchemaRequest.AddCopyField(name, Arrays.asList(indexed.copyTo()));
addCopyFieldRequest.process(solrClient, COLLECTION);
} catch (Exception e) {
logger.debug("Failed to add copy field", e);
if (indexed.copyTo().length > 0) {
try {
SchemaRequest.AddCopyField addCopyFieldRequest = new SchemaRequest.AddCopyField(name, Arrays.asList(indexed.copyTo()));
addCopyFieldRequest.process(solrClient, COLLECTION);
} catch (Exception e) {
logger.error("Failed to add copy field", e);
}
}
} catch (Exception e) {
logger.debug("Failed to add field", e);
}
}
}
Expand Down

0 comments on commit 12cc445

Please sign in to comment.