2017-09-20 26 views
1

我建立一個自定義的標記生成器響應這樣的:(?)Performance of doc_values field vs analysed field出現建立一個自定義標記生成器的elasticsearch

沒有這個API來進行記錄,所以我從其他插件去的代碼示例關閉/斷詞,但是當我重新啓動彈性已經部署了我的分詞我不斷地得到這個錯誤在日誌中:

[2017-09-20 08:45:37,412][WARN ][indices.cluster   ] [Samuel Silke] [[storm-crawler-2017-09-11][3]] marking and sending shard failed due to [failed to create index] 
[storm-crawler-2017-09-11] IndexCreationException[failed to create index]; nested: CreationException[Guice creation errors: 

1) Could not find a suitable constructor in com.cameraforensics.elasticsearch.plugins.UrlTokenizerFactory. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private. 
    at com.cameraforensics.elasticsearch.plugins.UrlTokenizerFactory.class(Unknown Source) 
    at org.elasticsearch.index.analysis.TokenizerFactoryFactory.create(Unknown Source) 
    at org.elasticsearch.common.inject.assistedinject.FactoryProvider2.initialize(Unknown Source) 
    at _unknown_ 

1 error]; 
    at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:360) 
    at org.elasticsearch.indices.cluster.IndicesClusterStateService.applyNewIndices(IndicesClusterStateService.java:294) 
    at org.elasticsearch.indices.cluster.IndicesClusterStateService.clusterChanged(IndicesClusterStateService.java:163) 
    at org.elasticsearch.cluster.service.InternalClusterService.runTasksForExecutor(InternalClusterService.java:610) 
    at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:772) 
    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:231) 
    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:194) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
    at java.lang.Thread.run(Thread.java:748) 
Caused by: org.elasticsearch.common.inject.CreationException: Guice creation errors: 

1) Could not find a suitable constructor in com.cameraforensics.elasticsearch.plugins.UrlTokenizerFactory. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private. 
    at com.cameraforensics.elasticsearch.plugins.UrlTokenizerFactory.class(Unknown Source) 
    at org.elasticsearch.index.analysis.TokenizerFactoryFactory.create(Unknown Source) 
    at org.elasticsearch.common.inject.assistedinject.FactoryProvider2.initialize(Unknown Source) 
    at _unknown_ 

1 error 
    at org.elasticsearch.common.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:360) 
    at org.elasticsearch.common.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:172) 
    at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:110) 
    at org.elasticsearch.common.inject.InjectorImpl.createChildInjector(InjectorImpl.java:157) 
    at org.elasticsearch.common.inject.ModulesBuilder.createChildInjector(ModulesBuilder.java:55) 
    at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:358) 
    ... 9 more 

我的分詞器是專爲v2.3.4,並且TokenizerFactory看起來是這樣的:

public class UrlTokenizerFactory extends AbstractTokenizerFactory { 

    @Inject 
    public UrlTokenizerFactory(Index index, IndexSettingsService indexSettings, @Assisted String name, @Assisted Settings settings){ 
     super(index, indexSettings.getSettings(), name, settings); 
    } 

    @Override 
    public Tokenizer create() { 
     return new UrlTokenizer(); 
    } 
} 

我真的不知道我做錯了什麼。我沒有正確部署它嗎?它似乎是根據日誌使用我的課程...

我只將它部署到我的一個es節點(4節點集羣)。該/_cat/plugins?v端點給出了這樣的:

name   component   version type url 
Samuel Silke urltokenizer  2.3.4.0 j   

由於幾乎沒有或在此過程中沒有文件,我已經遠遠被由其他人創建的插件複製構造得到這個。

我看到的錯誤沒有意義。我的TokenizerFactory看起來和其他人的這個版本的彈性一樣。我做錯了什麼,或者可能沒有這樣做,我應該做這個工作?

回答

相關問題