title: Index fields with hyphens in Elasticsearch
body: <p>I'm trying to work out how to configure elasticsearch so that I can make query string searches with wildcards on fields that include hyphens.</p>
  
  <p>I have documents that look like this:</p>
  
  <pre><code>{
     "tags":[
        "deck-clothing-blue",
        "crew-clothing",
        "medium"
     ],
     "name":"Crew t-shirt navy large",
     "description":"This is a t-shirt",
     "images":[
        {
           "id":"ba4a024c96aa6846f289486dfd0223b1",
           "type":"Image"
        },
        {
           "id":"ba4a024c96aa6846f289486dfd022503",
           "type":"Image"
        }
     ],
     "type":"InventoryType",
     "header":{
     }
  }
  </code></pre>
  
  <p>I have tried to use a word_delimiter filter and a whitespace tokenizer:</p>
  
  <pre><code>{
  "settings" : {
      "index" : {
          "number_of_shards" : 1,
          "number_of_replicas" : 1
      },  
      "analysis" : {
          "filter" : {
              "tags_filter" : {
                  "type" : "word_delimiter",
                  "type_table": ["- =&gt; ALPHA"]
              }   
          },
          "analyzer" : {
              "tags_analyzer" : {
                  "type" : "custom",
                  "tokenizer" : "whitespace",
                  "filter" : ["tags_filter"]
              }
          }
      }
  },
  "mappings" : {
      "yacht1" : {
          "properties" : {
              "tags" : {
                  "type" : "string",
                  "analyzer" : "tags_analyzer"
              }
          }
      }
  }
  }
  </code></pre>
  
  <p>But these are the searches (for tags) and their results:</p>
  
  <pre><code>deck*     -&gt; match
  deck-*    -&gt; no match
  deck-clo* -&gt; no match
  </code></pre>
  
  <p>Can anyone see where I'm going wrong?</p>
  
  <p>Thanks :)</p>