title: Dense vector array and cosine similarity
body: <p>I would like to store an array of <code>dense_vector</code> in my document but this does not work as it does for other data types eg.</p>
  
  <pre><code>PUT my_index
  {
    "mappings": {
      "properties": {
        "my_vectors": {
          "type": "dense_vector",
          "dims": 3  
        },
        "my_text" : {
          "type" : "keyword"
        }
      }
    }
  }
  
  PUT my_index/_doc/1
  {
    "my_text" : "text1",
    "my_vector" : [[0.5, 10, 6], [-0.5, 10, 10]]
  }
  
  </code></pre>
  
  <p>returns:</p>
  
  <pre><code>'1 document(s) failed to index.',
      {'_index': 'my_index', '_type': '_doc', '_id': 'some_id', 'status': 400, 'error': 
        {'type': 'mapper_parsing_exception', 'reason': 'failed to parse', 'caused_by': 
          {'type': 'parsing_exception', 
           'reason': 'Failed to parse object: expecting token of type [VALUE_NUMBER] but found [START_ARRAY]'
          }
        }
      }
  </code></pre>
  
  <p>How do I achieve this? Different documents will have a variable number of vectors but never more than a handful.</p>
  
  <p>Also, I would then like to query it by performing a <code>cosineSimilarity</code> for each value in that array. The code below is how I normally do it when I have only one vector in the doc.</p>
  
  <pre><code>"script_score": {
      "query": {
          "match_all": {}
      },
      "script": {
          "source": "(1.0+cosineSimilarity(params.query_vector, doc['my_vectors']))",
          "params": {"query_vector": query_vector}
      }
  }
  </code></pre>
  
  <p>Ideally, I would like the closest similarity or an average. </p>