title: Wildcard-querying an array with forward slash in the query
body: <p>In my documents indexed by elasticsearch, I have a field called <code>IPC8s.IPC8</code> which is an array of strings, which can look like these :</p>
  
  <pre><code>["B63H011/00"]
  ["B60F3", "B60K1", "B60K17", "B60K17/23", "B60K6", "B60K6"]
  ["G06F017/00"]
  etc...
  </code></pre>
  
  <p>(for anyone curious, these are CPC patent classification numbers)</p>
  
  <p>I need to query this field with trailing wildcards. In other words, if I put in "B63H", the document containing "B63H011/00" should match. Same if I put in "B63H011/" or "B63H011/0".</p>
  
  <p>I tried multiple queries, none of which worked :</p>
  
  <pre><code>{
    query_string: {
      default_field: "IPC8s.IPC8",
      query: "(B63H*) OR (B63H011/*)",
      analyze_wildcard: true
    }
  }
  </code></pre>
  
  <p>I tried this one also with <code>\"B63H*\" OR \"B63H011/*\"</code>, doesn't work.</p>
  
  <p>Then I tried :</p>
  
  <pre><code>[{
    wildcard: {
      "IPC8s.IPC8": { value: "B63H*" }
    }
  },
  {
    wildcard: {
      "IPC8s.IPC8": { value: "B63H011/*" }
    }
  }]
  </code></pre>
  
  <p>This doesn't work either. I then tried escaping the "/" because it has to be taken literally. Didn't work.</p>
  
  <p>What am I doing wrong ? Thanks.</p>
  
  <p><strong>Edit</strong> : Here is the mapping for that specific field :</p>
  
  <pre><code>"IPC8s": {
    "properties": {
      "IPC8": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>Here is my latest try that still didn't work (if I don't escape the forward slash, elasticsearch returns an error) :</p>
  
  <pre><code>{
    query_string: {
      default_field: "IPC8s.IPC8",
      query: "(B63H*) OR (B63H011\\/*)",
      analyze_wildcard: true,
      analyzer: "keyword"
    }
  }
  </code></pre>
  
  <p><strong>Edit 2</strong> : This seems to do the trick :</p>
  
  <pre><code>    {
        query_string: {
          default_field: "IPC8s.IPC8.keyword",
          query: "(B63H*) OR (B63H011\\/*)",
          analyze_wildcard: true,
          analyzer: "keyword"
        }
      }
  </code></pre>