francesconero / elasticsearch-concatenate-token-filter

Elasticsearch plugin which only provides a TokenFilter that merges tokens in a token stream back into one. Taken from http://elasticsearch-users.115913.n3.nabble.com/Is-there-a-concatenation-filter-td3711094.html
Apache License 2.0
13 stars 39 forks source link

problem using/installing (ESv2.2) #4

Closed iamjochem closed 8 years ago

iamjochem commented 8 years ago

hi there,

I too am having trouble getting your plugin to work (it's functionality is exactly what I am looking for, it would really help me out of a tight spot!) ... I've tried searching for possible solutions but failed to find anything, I hope you can help point me in the right direction ...

My ElasticSearch Installation

Running on Mac OS X, installed using brew and having the following version info:

{
    "number": "2.2.0",
    "build_hash": "8ff36d139e16f8720f2947ef62c8167a888992fe",
    "build_timestamp": "2016-01-27T13:32:39Z",
    "build_snapshot": false,
    "lucene_version": "5.4.1"
}

I ran the following command to install the plugin (there are no other plugins installed):

/usr/local/Cellar/elasticsearch/2.2.0_1/libexec/bin/plugin install francesconero/elasticsearch-concatenate-token-filter/2.2.0

My Problem ....

Restarting ElasticSearch fails with the following error (the logs mention the error in relation to pre-existing indexes):

IllegalStateException[[index.version.created] is not present in the 
index settings for index with uuid: [null]

If I close all my existing indexes before installing the plugin then ElasticSearch does restart successfully but I still cannot create any indexes, not even an index with no settings whatsoever (I get the same error regardless).

The index creation command I use for testing is as follows:

curl -XPOST "http://127.0.0.1:9200/brand_test" -d'
{
    "analysis"    : {
        "analyzer"      : {  
            "brand_name_tokens" : {
                "type"          : "custom",
                "char_filter"   : ["html_strip", "brandname_charstrip"],
                "tokenizer"     : "whitespace",
                "filter"        : ["lowercase", "asciifolding", "brand_synonyms", "brand_wordsplitter", "the_stop", "unique", "brand_concat"]
            }
        },
        "char_filter" : {
            "brandname_charstrip"  : {
                "type"          : "mapping",
                "mappings"      : [
                    "\"=>"
                ]
            }
        },
        "filter"        : {
            "the_stop"              : {
                "type"              : "stop",
                "remove_trailing"   : false,
                "stopwords"         : ["the"]
            },
            "brand_synonyms"        : {
                "type"              : "synonym",
                "synonyms"          : [
                    "& => and"
                ]
            },
            "brand_wordsplitter"    : {
                "type"                      : "word_delimiter",
                "split_on_case_change"      : false,
                "split_on_numerics"         : false,
                "stem_english_possessive"   : true,
                "generate_number_parts"     : false                
            },
             "brand_concat"         : {
                "type"              : "concatenate",
                "token_separator"   : " "
            }
        }
    }
}'

The full stack trace from elasticsearch.yml:

[2016-04-08 11:24:33,118][DEBUG][action.admin.indices.create] [Brute II] [brand_test] failed to create
[brand_test] IndexCreationException[failed to create index]; nested: IllegalStateException[[index.version.created] is not present in the index settings for index with uuid: [null]];
    at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:360)
    at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$1.execute(MetaDataCreateIndexService.java:309)
    at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:45)
    at org.elasticsearch.cluster.service.InternalClusterService.runTasksForExecutor(InternalClusterService.java:458)
    at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:762)
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: [index.version.created] is not present in the index settings for index with uuid: [null]
    at org.elasticsearch.Version.indexCreated(Version.java:540)
    at org.elasticsearch.index.analysis.Analysis.parseAnalysisVersion(Analysis.java:99)
    at org.elasticsearch.index.analysis.AbstractTokenFilterFactory.<init>(AbstractTokenFilterFactory.java:36)
    at org.elasticsearch.index.analysis.concatenate.ConcatenateTokenFilterFactory.<init>(ConcatenateTokenFilterFactory.java:25)
    at sun.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.elasticsearch.common.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:50)
    at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:86)
    at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:104)
    at org.elasticsearch.common.inject.FactoryProxy.get(FactoryProxy.java:54)
    at org.elasticsearch.common.inject.InjectorImpl$5$1.call(InjectorImpl.java:828)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:887)
    at org.elasticsearch.common.inject.InjectorImpl$5.get(InjectorImpl.java:823)
    at org.elasticsearch.common.inject.assistedinject.FactoryProvider2.invoke(FactoryProvider2.java:236)
    at com.sun.proxy.$Proxy16.create(Unknown Source)
    at org.elasticsearch.index.analysis.AnalysisService.<init>(AnalysisService.java:161)
    at org.elasticsearch.index.analysis.AnalysisService.<init>(AnalysisService.java:66)
    at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.elasticsearch.common.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:50)
    at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:86)
    at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:104)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:47)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:887)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:43)
    at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:59)
    at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:46)
    at org.elasticsearch.common.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
    at org.elasticsearch.common.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
    at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:85)
    at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:104)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:47)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:887)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:43)
    at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:59)
    at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:46)
    at org.elasticsearch.common.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
    at org.elasticsearch.common.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
    at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:85)
    at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:104)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:47)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:887)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:43)
    at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:59)
    at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:46)
    at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:201)
    at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:193)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:880)
    at org.elasticsearch.common.inject.InjectorBuilder.loadEagerSingletons(InjectorBuilder.java:193)
    at org.elasticsearch.common.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:175)
    at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:110)
    at org.elasticsearch.common.inject.InjectorImpl.createChildInjector(InjectorImpl.java:159)
    at org.elasticsearch.common.inject.ModulesBuilder.createChildInjector(ModulesBuilder.java:55)
    at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:358)
    ... 9 more

thanks for reading! any ideas?

PS: I have no java skills, I'm just an [ab]user ;-)

bomberby commented 8 years ago

Hi, is this a newly installed ElasticSearch or just upgraded to 2.X? Because that sounds like an error i've had when upgrading that was not related to the plugin. My solution was to add to the elasticsearch.yml file the following line: index.version.created: 2020099

Much thanks to this helpful answer http://stackoverflow.com/questions/27685698/elasticsearchillegalstateexceptionindex-version-created-is-not-present-in-the

iamjochem commented 8 years ago

Strangely enough it's a clean install not an upgrade.

I had actually found tried adding index.version.created: 2020099 to my config before but I was still getting errors (so I assumed it was a red herring), I just tried again and now it works, I believe the order of actions matters, namely:

  1. add index.version.created: <FOO> to config
  2. restart ES
  3. install plugin
  4. restart ES

adding the config line after the plugin is installed will not work (I realise that this is what I did in my previous attempts).

anyway thanks for your time, I have it working now!