I want to code an elasticsearch plugin (via AbstractPlugin) that
exposes ids for freshly indexed documents. How can I hook into
ShardIndexingService.addListener()?
I tried to get an instance of ShardIndexingService through the @Inject
annotation. But that fails with an error.
Constructor is: @Inject
public ChangesAction(Settings settings, Client client, RestController
controller, ShardIndexingService serv) {
super(settings, client);
controller.registerHandler(GET, "/_changes/", this);
}
Error is:
No implementation for org.elasticsearch.common.settings.Settings
annotated with @org.elasticsearch.index.settings.IndexSettings() was
bound.2) Could not find a suitable constructor in
org.elasticsearch.index.shard.ShardId. Classes must have either one
(and only one) constructor annotated with @Inject or a zero-argument
constructor that is not private.
When I remove ShardIndexingService from the constructor I get no error
(but no ShardIndexingService instance as well).
I think it is a timing issue because ShardIndexingService has not been
started when my plugin gets initialized.
I want to code an elasticsearch plugin (via AbstractPlugin) that
exposes ids for freshly indexed documents. How can I hook into
ShardIndexingService.addListener()?
I tried to get an instance of ShardIndexingService through the @Inject
annotation. But that fails with an error.
Constructor is: @Inject
public ChangesAction(Settings settings, Client client,
RestController
controller, ShardIndexingService serv) {
super(settings, client);
controller.registerHandler(GET, "/_changes/", this);
}
Error is:
No implementation for org.elasticsearch.common.settings.Settings
annotated with @org.elasticsearch.index.settings.IndexSettings() was
bound.2) Could not find a suitable constructor in
org.elasticsearch.index.shard.ShardId. Classes must have either one
(and only one) constructor annotated with @Inject or a zero-argument
constructor that is not private.
When I remove ShardIndexingService from the constructor I get no error
(but no ShardIndexingService instance as well).
I think it is a timing issue because ShardIndexingService has not been
started when my plugin gets initialized.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.