Search in sources :

Example 1 with IndexerRequest

use of org.xwiki.search.solr.internal.job.IndexerRequest in project xwiki-platform by xwiki.

the class SolrIndexInitializeListener method onEvent.

@Override
public void onEvent(Event event, Object source, Object data) {
    if (this.configuration.synchronizeAtStartup()) {
        // Start synchronization
        IndexerRequest request = new IndexerRequest();
        request.setId(Arrays.asList("solr", "indexer"));
        try {
            this.solrIndexer.get().startIndex(request);
        } catch (SolrIndexerException e) {
            this.logger.error("Failed to start initial Solr index synchronization", e);
        }
    }
}
Also used : SolrIndexerException(org.xwiki.search.solr.internal.api.SolrIndexerException) IndexerRequest(org.xwiki.search.solr.internal.job.IndexerRequest)

Aggregations

SolrIndexerException (org.xwiki.search.solr.internal.api.SolrIndexerException)1 IndexerRequest (org.xwiki.search.solr.internal.job.IndexerRequest)1