Commit 5b48ca03 authored by Benoit Lavenier's avatar Benoit Lavenier

[enh] Add doc stat on subscription/record

parent a6c532b2
Pipeline #3277 passed with stage
in 24 seconds
......@@ -22,9 +22,18 @@ package org.duniter.elasticsearch.subscription;
* #L%
*/
import org.duniter.elasticsearch.service.DocStatService;
import org.duniter.elasticsearch.subscription.dao.SubscriptionIndexDao;
import org.duniter.elasticsearch.subscription.dao.record.SubscriptionRecordDao;
import org.duniter.elasticsearch.subscription.service.SubscriptionService;
import org.duniter.elasticsearch.threadpool.ThreadPool;
import org.duniter.elasticsearch.user.dao.group.GroupCommentDao;
import org.duniter.elasticsearch.user.dao.group.GroupIndexDao;
import org.duniter.elasticsearch.user.dao.group.GroupRecordDao;
import org.duniter.elasticsearch.user.dao.page.PageCommentDao;
import org.duniter.elasticsearch.user.dao.page.PageIndexDao;
import org.duniter.elasticsearch.user.dao.page.PageRecordDao;
import org.duniter.elasticsearch.user.service.*;
import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.Injector;
......@@ -97,6 +106,13 @@ public class PluginInit extends AbstractLifecycleComponent<PluginInit> {
logger.debug("Checking indices [OK]");
}
}
// Register stats on indices
if (pluginSettings.enableDocStats()) {
injector.getInstance(DocStatService.class)
.registerIndex(SubscriptionIndexDao.INDEX, SubscriptionRecordDao.TYPE)
;
}
}
protected void doAfterStart() {
......
......@@ -81,6 +81,10 @@ public class PluginSettings extends AbstractLifecycleComponent<PluginSettings> {
return settings.getAsBoolean("duniter.subscription.enable", Boolean.TRUE);
}
public boolean enableDocStats() {
return delegate.enableDocStats();
}
/**
* @deprecated use getEmailLinkUrl instead
* @return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment