# Custom Analyzer Provider requires org.elasticsearch package

**URL:** <https://discuss.elastic.co/t/custom-analyzer-provider-requires-org-elasticsearch-package/3003>\
**Category:** Elasticsearch\
**Created:** [June 8, 2010, 11:42pm UTC](https://discuss.elastic.co/t/custom-analyzer-provider-requires-org-elasticsearch-package/3003 "2010-06-08T23:42:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Chang](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@John\_Chang](https://discuss.elastic.co/u/John_Chang)\
**Post date:** [June 8, 2010, 11:42pm UTC](https://discuss.elastic.co/t/custom-analyzer-provider-requires-org-elasticsearch-package/3003/1 "2010-06-08T23:42:49Z")

</div>

I created a custom analyzer provider and plugged it into my elasticsearch.yml like this:  
index:  
analysis:  
analyzer:  
standard:  
type: com.mycompany.server.services.index.MyCompanyAnalyzerProvider

When I start the node, I get:

Exception in thread "elasticsearch[Malice]clusterService#updateTask-pool-4-thread-1" org.elasticsearch.util.inject.CreationException: Guice creation errors:

1. Error injecting constructor, org.elasticsearch.util.settings.SettingsException: Component [com.mycompany.server.services.index.MyCompanyAnalyzerProvider] does not start with prefix [org.elasticsearch]  
at org.elasticsearch.index.analysis.AnalysisService.(Unknown Source)

If I recompile the class so the package starts with org.elasticsearch, it starts with no error.  
So, this isn't fatal, but I do find it surprising. I've had to obey interfaces to plug in classes, but never package names. Is this as intended? If so, I was curious what the purpose was?

As always, thanks for your time.

BTW -  
In a previous post titled "How to set the anlyzer?" I could not get a custom analyzer provider to work; I figured that out (as you can see from context here), which lead to this post.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 10, 2010, 9:42pm UTC](https://discuss.elastic.co/t/custom-analyzer-provider-requires-org-elasticsearch-package/3003/2 "2010-06-10T21:42:29Z")

</div>

Can you post your implementation? Basically, when you extend the  
AbstractIndexComponent, it automatically tries and create component based  
settings based on the prefix, the default prefix is "org.elasticsearch", you  
should call a super with another parameter that includes your "company  
prefix", for example: 'com.mycompany'.

-shay.banon

On Wed, Jun 9, 2010 at 2:42 AM, John Chang [jchangkihtest2@gmail.com](mailto:jchangkihtest2@gmail.com) wrote:

> I created a custom analyzer provider and plugged it into my  
> elasticsearch.yml  
> like this:  
> index:  
> analysis:  
> analyzer:  
> standard:  
> type: com.mycompany.server.services.index.MyCompanyAnalyzerProvider
> 
> When I start the node, I get:
> 
> Exception in thread  
> "elasticsearch[Malice]clusterService#updateTask-pool-4-thread-1"  
> org.elasticsearch.util.inject.CreationException: Guice creation errors:
> 
> 1. Error injecting constructor,  
> org.elasticsearch.util.settings.SettingsException: Component  
> [com.mycompany.server.services.index.MyCompanyAnalyzerProvider] does not  
> start with prefix [org.elasticsearch]  
> at org.elasticsearch.index.analysis.AnalysisService.(Unknown Source)
> 
> If I recompile the class so the package starts with org.elasticsearch, it  
> starts with no error.  
> So, this isn't fatal, but I do find it surprising. I've had to obey  
> interfaces to plug in classes, but never package names. Is this as  
> intended? If so, I was curious what the purpose was?
> 
> As always, thanks for your time.
> 
> ## BTW - In a previous post titled "How to set the anlyzer?" I could not get a custom analyzer provider to work; I figured that out (as you can see from context here), which lead to this post.
> 
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Custom-Analyzer-Provider-requires-org-elasticsearch-package-tp880872p880872.html](http://elasticsearch-users.115913.n3.nabble.com/Custom-Analyzer-Provider-requires-org-elasticsearch-package-tp880872p880872.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![John\_Chang](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@John\_Chang](https://discuss.elastic.co/u/John_Chang)\
**Post date:** [June 10, 2010, 11:25pm UTC](https://discuss.elastic.co/t/custom-analyzer-provider-requires-org-elasticsearch-package/3003/3 "2010-06-10T23:25:24Z")

</div>

Here is my implementation \<nabble\_a href="KihaAnalyzerProvider.java"\>KihaAnalyzerProvider.java\</nabble\_a\>

---

<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, 4:23am UTC](https://discuss.elastic.co/t/custom-analyzer-provider-requires-org-elasticsearch-package/3003/4 "2017-07-06T04:23:22Z")

</div>


