title: How to add custom analyzer to mapping ElasticSearch-2.3.5 for partial searching?
body: <p>I use ElasticSearch-2.3.5. I want to add my custom analyzer to mapping while index creating. </p>
  
  <p><code>PUT /library</code></p>
  
  <pre><code>{
    "settings": {
      "analysis": {
        "tokenizer": {
          "ngram_tokenizer": {
            "type": "nGram",
            "min_gram": "1",
            "max_gram": "15",
            "token_chars": [
              "letter",
              "digit"
            ]
          }
        },
        "analyzer": {
          "index_ngram_analyzer": {
            "type": "custom",
            "tokenizer": "ngram_tokenizer",
            "filter": [
              "lowercase"
            ]
          }
        },
        "search_term_analyzer": {
          "type": "custom",
          "tokenizer": "keyword",
          "filter": "lowercase"
        }
      }
    },
    "mappings": {
        "book": {
          "properties": {
            "Id": {
              "type": "long",
              "search_analyzer": "search_term_analyzer",
              "index_analyzer": "index_ngram_analyzer",
              "term_vector":"with_positions_offsets"
            },
            "Title": {
              "type": "string",
              "search_analyzer": "search_term_analyzer",
              "index_analyzer": "index_ngram_analyzer",
              "term_vector":"with_positions_offsets"
            }
          }
        }
      }
  }
  </code></pre>
  
  <p>I take a template example from <a href="https://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-create-index.html" rel="nofollow noreferrer">official guide</a>. </p>
  
  <pre><code>{
      "settings" : {
          "number_of_shards" : 1
      },
      "mappings" : {
          "type1" : {
              "properties" : {
                  "field1" : { "type" : "string", "index" : "not_analyzed" }
              }
          }
      }
  }
  </code></pre>
  
  <p>But I get an error trying to execute the first part of code. There is my error:</p>
  
  <pre><code>{
    "error": {
      "root_cause": [
        {
          "type": "mapper_parsing_exception",
          "reason": "analyzer [search_term_analyzer] not found for field [Title]"
        }
      ],
      "type": "mapper_parsing_exception",
      "reason": "Failed to parse mapping [book]: analyzer [search_term_analyzer] not found for field [Title]",
      "caused_by": {
        "type": "mapper_parsing_exception",
        "reason": "analyzer [search_term_analyzer] not found for field [Title]"
      }
    },
    "status": 400
  }
  </code></pre>
  
  <p>I can do it if I put my <code>mappings</code> inside of <code>settings</code>, but I think that it is wrong way. So I try to find my book by using a part of title. I have the "King Arthur" book for example. My query looks like this:</p>
  
  <p><code>POST /library/book/_search</code></p>
  
  <pre><code>{
      "query": {
          "match": {
              "Title": "kin"
          }
      }
  }
  </code></pre>
  
  <p>Nothing will be found. What I do wrong? Could you help me? It seems my analyzer and tokenizer don't work. How can I get the terms "k", "i", "ki", "king" etc.? Because I think that I have only two terms right now. There are 'king' and 'arthur'.</p>