Elasticsearch TransportError(400, u'MapperParsingException
Question: I have run the following python code with no errors. But now I am having this

    
    
    TransportError(400, u'MapperParsingException [Analyzer [whitespace_analyzer] not found for field [job style]]'
    

The code is :

    
    
    from elasticsearch import Elasticsearch
    import xlrd
    
    es = Elasticsearch()
    
    
    
    es.indices.create("we_doing",body={
          'settings': {
            "analysis": {
             "tokenizer":{
                "camel":{
                        "type": "pattern",
                        "pattern":"([^\\\\p{L}\\\\d]+)|(?<=\\\\D)(?=\\\\d)|(?<=\\\\d)(?=\\\\D)|(?<=[\\\\p{L}&&[^\\\\p{Lu}]])(?=\\\\p{Lu})|(?<=\\\\p{Lu})(?=\\\\p{Lu}[\\\\p{L}&&[^\\\\p{Lu}]])"
                    }},
    
         "analyzer": {
            "nGram_analyzer": {
               "type": "custom",
               "tokenizer": ["whitespace","camel"],
               "filter": [
                  "lowercase",
                  "asciifolding"
    
               ]
            },
            "whitespace_analyzer": {
               "type": "custom",
               "tokenizer": ["whitespace","camel"],
               "filter": [
                  "lowercase",
                  "asciifolding"
               ]
            }}}}}, ignore = 400 ) 
    
    mapping = {
    "we_data": {
    
        "properties": {
            "job id": {"type": "string", "index": "not_analyzed"},
    
            "job style":{
            "type":"string",
    
            "index_analyzer": "nGram_analyzer",
            "search_analyzer": 'whitespace_analyzer',
    
    
        },
    
            "location": {"type": "string", "index": "not_analyzed"},
            "experience": {"type": "string", "index": "not_analyzed"},
            "post date": {"type": "string", "index": "not_analyzed"},
            "job description": {"type": "string", "index": "not_analyzed"},
    
        }}}
    
    
    es.indices.put_mapping(index="we_doing", doc_type="we_data", body=mapping)
    

It was working perfectly. now i am in so much trouble. Its going to be live in
2 days. please be of some help .


Answer: Only one tokenizer can be used by an analyzer(per [Elasticsearch Analysis
reference
page](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis.html)).
You'll need to use a TokenFilter to take to the place of one of them ([Word
Delimiter Token
Filter](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-
word-delimiter-tokenfilter.html#analysis-word-delimiter-tokenfilter) should do
nicely), or use a Tokenizer that accomplishes both.

