# Does spring-elasticsearch support plugins loading?

**URL:** <https://discuss.elastic.co/t/does-spring-elasticsearch-support-plugins-loading/10027>\
**Category:** Elasticsearch\
**Created:** [December 11, 2012, 2:54am UTC](https://discuss.elastic.co/t/does-spring-elasticsearch-support-plugins-loading/10027 "2012-12-11T02:54:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spancer\_ray](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spancer_ray/32/76303_2.png) [@spancer\_ray](https://discuss.elastic.co/u/spancer_ray)\
**Post date:** [December 11, 2012, 2:54am UTC](https://discuss.elastic.co/t/does-spring-elasticsearch-support-plugins-loading/10027/1 "2012-12-11T02:54:12Z")

</div>

Hi Guys,

I'm trying to integrate spring with elasticsearch using [https://github.com/dadoonet/spring-elasticsearch](https://github.com/dadoonet/spring-elasticsearch).

And I'm wondering whether I can setup plugins like 'ik analyzer' or 'river plugin' in my app while integrating ES

and spring. Following the guide, I have my es.properties under src folder, and I identified the path.data,

path.plugins and path.conf directories, and I have the customer analyzer defined as below:

index.analysis.analyzer.ansj.type="ansj".

However, while doing river, I got the exception message:

org.elasticsearch.indices.IndexCreationException: [\_river] failed to create index  
at org.elasticsearch.indices.InternalIndicesService.createIndex(InternalIndicesService.java:289)  
at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$1.execute(MetaDataCreateIndexService.java:241)  
at org.elasticsearch.cluster.service.InternalClusterService$2.run(InternalClusterService.java:208)  
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)  
Caused by: org.elasticsearch.ElasticSearchIllegalArgumentException: failed to find analyzer type ["ansj"] or tokenizer for [ansj]  
at org.elasticsearch.index.analysis.AnalysisModule.configure(AnalysisModule.java:372)  
at org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:60)  
at org.elasticsearch.common.inject.spi.Elements$RecordingBinder.install(Elements.java:201)  
at org.elasticsearch.common.inject.spi.Elements.getElements(Elements.java:82)  
at org.elasticsearch.common.inject.InjectorShell$Builder.build(InjectorShell.java:130)  
at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:99)  
at org.elasticsearch.common.inject.InjectorImpl.createChildInjector(InjectorImpl.java:129)  
at org.elasticsearch.common.inject.ModulesBuilder.createChildInjector(ModulesBuilder.java:66)  
at org.elasticsearch.indices.InternalIndicesService.createIndex(InternalIndicesService.java:287)  
... 5 more  
Caused by: org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class setting [type] with value ["ansj"]  
at org.elasticsearch.common.settings.ImmutableSettings.getAsClass(ImmutableSettings.java:243)  
at org.elasticsearch.index.analysis.AnalysisModule.configure(AnalysisModule.java:356)  
... 13 more  
Caused by: java.lang.ClassNotFoundException: "ansj"  
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)  
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)  
at org.elasticsearch.common.settings.ImmutableSettings.getAsClass(ImmutableSettings.java:227)  
... 14 more

It seems the integrated ES service can't recognize ansj settings:index.analysis.analyzer.ansj.type="ansj". ... I'm quite puzzled, this configuration works when

without integrating.. At first, I think ES didn't load my plugins directory.. But river & head plugin did work

well.. And while river with default analyzer, it works fine... I don't know how to integrate customer analyzer

with my app while using [https://github.com/dadoonet/spring-elasticsearch](https://github.com/dadoonet/spring-elasticsearch).

Can anyone help?

Thanks a ton,  
Spancer

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 11, 2012, 9:47am UTC](https://discuss.elastic.co/t/does-spring-elasticsearch-support-plugins-loading/10027/2 "2012-12-11T09:47:41Z")

</div>

Hi,

Did you try to add your plugin as a maven dependency in your pom.xml file?  
It could be easier to manage it.

## HTH

David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 11 déc. 2012 à 03:54, spancer ray [spancer.roc.ray@gmail.com](mailto:spancer.roc.ray@gmail.com) a écrit :

> Hi Guys,
> 
> I'm trying to integrate spring with elasticsearch using  
> [GitHub - dadoonet/spring-elasticsearch: Spring factories for elasticsearch](https://github.com/dadoonet/spring-elasticsearch).
> 
> And I'm wondering whether I can setup plugins like 'ik analyzer' or 'river  
> plugin' in my app while integrating ES
> 
> and spring. Following the guide, I have my es.properties under src folder,  
> and I identified the path.data,
> 
> path.plugins and path.conf directories, and I have the customer analyzer  
> defined as below:
> 
> However, while doing river, I got the exception message:
> 
> It seems the integrated ES service can't recognize ansj settings:... I'm  
> quite puzzled, this configuration works when
> 
> without integrating.. At first, I think ES didn't load my plugins  
> directory.. But river & head plugin did work
> 
> well.. And while river with default analyzer, it works fine... I don't know  
> how to integrate customer analyzer
> 
> with my app while using [GitHub - dadoonet/spring-elasticsearch: Spring factories for elasticsearch](https://github.com/dadoonet/spring-elasticsearch).
> 
> Can anyone help?
> 
> Thanks a ton,  
> Spancer
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Does-spring-elasticsearch-support-plugins-loading-tp4026799.html](http://elasticsearch-users.115913.n3.nabble.com/Does-spring-elasticsearch-support-plugins-loading-tp4026799.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:00am UTC](https://discuss.elastic.co/t/does-spring-elasticsearch-support-plugins-loading/10027/3 "2017-07-06T03:00:22Z")

</div>


