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:
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.
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'.
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:
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.
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.