# Defining a new analyzer provider forces pakcage name of the provider to begin with org.elasticsearch

**URL:** <https://discuss.elastic.co/t/defining-a-new-analyzer-provider-forces-pakcage-name-of-the-provider-to-begin-with-org-elasticsearch/3696>\
**Category:** Elasticsearch\
**Created:** [December 23, 2010, 11:27am UTC](https://discuss.elastic.co/t/defining-a-new-analyzer-provider-forces-pakcage-name-of-the-provider-to-begin-with-org-elasticsearch/3696 "2010-12-23T11:27:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erez/32/3182_2.png) [@erez](https://discuss.elastic.co/u/erez)\
**Post date:** [December 23, 2010, 11:27am UTC](https://discuss.elastic.co/t/defining-a-new-analyzer-provider-forces-pakcage-name-of-the-provider-to-begin-with-org-elasticsearch/3696/1 "2010-12-23T11:27:06Z")

</div>

My elasticsearch properties define my own type:

index.analysis.analyzer.my\_analyzer.type=org.me.index.analysis.MyWonderfulAnalyzerProvider

When I run it I get a **org.elasticsearch.common.settings.SettingsException** :

Caused by: org.elasticsearch.common.settings.SettingsException: Component [org.me.index.analysis.MyWonderfulAnalyzerProvider] does not start with prefix [org.elasticsearch] at org.elasticsearch.common.settings.ImmutableSettings.getComponentSettings(ImmutableSettings.java:91) at org.elasticsearch.common.settings.ImmutableSettings.getComponentSettings(ImmutableSettings.java:85) at org.elasticsearch.index.AbstractIndexComponent.(AbstractIndexComponent.java:46) at org.elasticsearch.index.analysis.AbstractIndexAnalyzerProvider.(AbstractIndexAnalyzerProvider.java:36) ...

**ImmutableSettings.java** :

```
<raw>@Override public Settings getComponentSettings(Class component) {
    return getComponentSettings("org.elasticsearch", component);
}

@Override public Settings getComponentSettings(String prefix, Class component) {
    String type = component.getName();
    if (!type.startsWith(prefix)) {
        throw new SettingsException("Component [" + type + "] does not start with prefix [" + prefix + "]");
    }
    String settingPrefix = type.substring(prefix.length() + 1); // 1 for the '.'
    settingPrefix = settingPrefix.substring(0, settingPrefix.length() - component.getSimpleName().length()); // remove the simple class name (keep the dot)
    return getByPrefix(settingPrefix);
}</raw>

```

If I change my provider's package to begin with **org.elasticsearch** then everything works fine. However this kind of restriction is suspicious in nature. Why should I be required to define this class in this package and not in my own packages?

---

<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:14am UTC](https://discuss.elastic.co/t/defining-a-new-analyzer-provider-forces-pakcage-name-of-the-provider-to-begin-with-org-elasticsearch/3696/2 "2017-07-06T04:14:53Z")

</div>


