title: Query String Query in Elasticsearch with - and *
body: <p>I have a problem with <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html" rel="nofollow">Query String Query</a> in Elasticsearch. I write here a Sense code to replicate it.</p>
  
  <pre><code>POST myindex
  POST myindex/mytype
      {
          "name":"t-shirt",
          "season": "2016-3"
      }
  </code></pre>
  
  <p>And I search:</p>
  
  <pre><code>POST myindex/_search
  {
      "query": {
          "query_string": {
             "query": "2016-*",
             "fields": ["name", "season"]
          }
      }
  }
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>POST myindex/_search
  {
      "query": {
          "query_string": {
             "query": "t-shirt*"
          }
      }
  }
  </code></pre>
  
  <p>These queries return no documents (but it should return the indexed document) and I don't know how to fix it.</p>
  
  <p>I want to be generic as possible because this is an example, but my documents have a lot of field and the a user can search what he wants without limitations in the syntax.</p>