MapperParsingException creating elasticsearch index
<p>I'm trying to create the following index and mapping.</p>

<pre><code>CreateIndexRequestBuilder createIndexRequestBuilder = client.admin().indices().prepareCreate("my_index");



            XContentBuilder mappingBuilder = jsonBuilder()
                    .startObject()
                        .startObject("my_type")
                            .startObject("properties")
                                .startObject("nombre")
                                    .field("analyzer", "keyword_lowercase")
                                    .field("type", "string")                                    
                                .endObject()                                
                                .startObject("codigo")
                                    .field("type", "string")
                                    .field("analyzer", "keyword_lowercase")
                                .endObject()                                
                            .endObject()
                        .endObject()
                    .endObject();

             createIndexRequestBuilder.addMapping(document.type(), mappingBuilder);


            XContentBuilder mappingSettingsBuilder = jsonBuilder()
                    .startObject()                          
                            .startObject("index")
                                .startObject("analisis")
                                    .startObject("analyzer")
                                        .startObject("keyword_lowercase")
                                            .field("type","custom")
                                            .field("tokenizer","keyword")
                                            .array("filter", "lowercase")
                                        .endObject()
                                    .endObject()
                                .endObject()
                            .endObject()                            
                    .endObject();

            createIndexRequestBuilder.setSettings(mappingSettingsBuilder);


            createIndexRequestBuilder.execute().actionGet();
</code></pre>

<p>But I'm getting the following exception:</p>

<blockquote>
  <p>org.elasticsearch.index.mapper.MapperParsingException: analyzer
  [keyword_lowercase] not found for field [codigo]</p>
</blockquote>

<p>I guess I have to close/open the index in any way to get success but I don´t know when ... I have tested several things without success. Any idea?</p>

<p>Thanks very much in advance</p>