2017-09-20 4 views
1

나는이에 대한 응답에서 사용자 지정 토크 나이를 짓고 있어요에 대한 사용자 정의 토큰 화 구축이 API의는 elasticsearch

없음이 나타납니다 Performance of doc_values field vs analysed field 문서화하기 위해, 그래서 다른 플러그인에서 코드 샘플의 오프거야 나는 탄성 다시 시작할 때/tokenizers,하지만 내가 로그에 지속적으로이 오류가 내 토크 나이를 배치 한 :

내 토크 나이는 v2.3.4을 위해 만들어진, 그리고 TokenizerFactory이처럼 보이는
[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 

:

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는 다른 모든 사람들처럼이 탄성 버전에 적합합니다. 내가 뭘 잘못하고 있니, 아니면 내가이 일을해야한다는 것을하지 않았을까?

답변

0

나는 밖으로 Environment 변수가 빠졌습니다. 그것은이 있었어야 : https://github.com/codelibs/elasticsearch-analysis-kuromoji-neologd/blob/2.3.x/src/main/java/org/codelibs/elasticsearch/kuromoji/neologd/index/analysis/KuromojiTokenizerFactory.java

: public UrlTokenizerFactory(Index index, IndexSettingsService indexSettings, Environment env, @Assisted String name, @Assisted Settings settings){ ...

나는 결국 여기에 비슷한 일을 발견