title: Elasticsearch match all tags within given array
body: <p>Currently developing a tag search application using elasticsearch, I have given each document within the index an array of tags, here's an example of how a document looks:</p>
  
  <pre><code>_source: {
    title: "Keep in touch scheme",
    intro: "&lt;p&gt;hello this is a test&lt;/p&gt; ",
    full: " &lt;p&gt;again this is a test mate&lt;/p&gt;",
    media: "",
    link: "/training/keep-in-touch",
    tags: [
      "employee",
      "training"
    ]
  }
  </code></pre>
  
  <p>I would like to be able to make a search and only return documents with all of the specified tags.</p>
  
  <p>Using the above example, if I searched for a document with tags <code>["employee", "training"]</code> then the above result would be returned. </p>
  
  <p>In contrast, if I searched with tags <code>["employee", "other"]</code>, then nothing would be returned; all tags within the search query must match.</p>
  
  <p>Currently I am doing:</p>
  
  <pre><code>query: {
    bool: {
      must: [
        { match: { tags: ["employee","training"] }}
       ]
     }
   }
  </code></pre>
  
  <p>but I am just getting returned exceptions like </p>
  
  <pre><code>IllegalStateException[Can't get text on a START_ARRAY at 1:128];
  </code></pre>
  
  <p>I have also tried concatenating the arrays and using comma-delimited strings, however this seems to match anything given the first tag matches.</p>
  
  <p>Any suggestions on how to approach this? Cheers</p>