Custom Analyzer Provider requires org.elasticsearch package

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Custom Analyzer Provider requires org.elasticsearch package

John Chang
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.<init>(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.
Reply | Threaded
Open this post in threaded view
|

Re: Custom Analyzer Provider requires org.elasticsearch package

kimchy
Administrator
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 <[hidden email]> 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.<init>(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
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Custom Analyzer Provider requires org.elasticsearch package

John Chang
Here is my implementation KihaAnalyzerProvider.java