Class SolrIndexWorkerUtil

java.lang.Object
com.broadleafcommerce.search.index.solr.worker.SolrIndexWorkerUtil

public class SolrIndexWorkerUtil extends Object
Utility class to handle common operations for Solr index worker classes, e.g. SolrProductIndexWorker.
Since:
2.1.2-GA, 2.0.3-GA
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    writeDocumentsToSolrInChunks(@NonNull Collection<? extends List<? extends com.broadleafcommerce.search.api.domain.Indexable<?>>> indexablesById, @NonNull AtomicInteger processCount, @NonNull String collection, @NonNull String indexableType, @NonNull com.broadleafcommerce.search.index.core.document.DocumentBuilder<org.apache.solr.common.SolrInputDocument> documentBuilder, @NonNull com.broadleafcommerce.search.provider.solr.SolrIndexProvider solrIndexProvider)
    Rather than writing an indexable by ID to Solr or all the indexables at once, this method aggregates them into chunks to keep from sending excessively large requests to Solr or having poor performance by only sending a couple records at a time when grouped by ID.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NO_COMMIT_WITHIN_TIME

      protected static final int NO_COMMIT_WITHIN_TIME
      See Also:
  • Constructor Details

  • Method Details

    • writeDocumentsToSolrInChunks

      public void writeDocumentsToSolrInChunks(@NonNull @NonNull Collection<? extends List<? extends com.broadleafcommerce.search.api.domain.Indexable<?>>> indexablesById, @NonNull @NonNull AtomicInteger processCount, @NonNull @NonNull String collection, @NonNull @NonNull String indexableType, @NonNull @NonNull com.broadleafcommerce.search.index.core.document.DocumentBuilder<org.apache.solr.common.SolrInputDocument> documentBuilder, @NonNull @NonNull com.broadleafcommerce.search.provider.solr.SolrIndexProvider solrIndexProvider)
      Rather than writing an indexable by ID to Solr or all the indexables at once, this method aggregates them into chunks to keep from sending excessively large requests to Solr or having poor performance by only sending a couple records at a time when grouped by ID. See SolrIndexWorkerProperties.getChunkSize(java.lang.String) for configuring the chunk size globally or per indexable type.
    • getProperties

      protected SolrIndexWorkerProperties getProperties()