Skip to content

Commit def8ce8

Browse files
committed
XWIKI-23239: Improve Solr indexing speed through parallelization and batch processing
* Compute the Solr document ID outside the client thread as it needs access to the XWiki environment.
1 parent f3dd2fd commit def8ce8

File tree

1 file changed

+4
-3
lines changed
  • xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal

1 file changed

+4
-3
lines changed

xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/DefaultSolrIndexer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,14 +581,15 @@ private boolean processBatch(IndexQueueEntry queueEntry)
581581
return true;
582582
}
583583

584-
private void applyDeletion(IndexQueueEntry queueEntry)
584+
private void applyDeletion(IndexQueueEntry queueEntry) throws SolrIndexerException
585585
{
586+
String id = queueEntry.reference == null ? null : this.solrRefereceResolver.getId(queueEntry.reference);
586587
this.solrClientExecutor.execute(() -> {
587588
try {
588-
if (queueEntry.reference == null) {
589+
if (id == null) {
589590
this.solrInstance.deleteByQuery(queueEntry.deleteQuery);
590591
} else {
591-
this.solrInstance.delete(this.solrRefereceResolver.getId(queueEntry.reference));
592+
this.solrInstance.delete(id);
592593
}
593594
} catch (Exception e) {
594595
this.logger.error("Failed to delete document [{}] from the Solr server", queueEntry, e);

0 commit comments

Comments
 (0)