title: map and query on multidimensional array in elasticsearch
body: <p>I'm very newbie to ElasticSearch. This is how my data looks like.how can I map and query on the following data.</p>
  
  <pre><code>[parameters] =&gt; Array
      (
          [0] =&gt; Array
              (
                  [param_id] =&gt; "Browser"
                  [param_values] =&gt; Array
                      (
                          [0] =&gt; "Firefox"
                      )
              )
  
          [1] =&gt; Array
              (
                  [param_id] =&gt; "BrowserVersion"
                  [param_values] =&gt; Array
                      (
                          [0] =&gt; "39"
                      )
              )
  
          [2] =&gt; Array
              (
                  [param_id] =&gt; "OS"
                  [param_values] =&gt; Array
                      (
                          [0] =&gt; "Windows"
                      )
              )
  
          [3] =&gt; Array
              (
                  [param_id] =&gt; "Softwares"
                  [param_values] =&gt; Array
                      (
                          [0] =&gt; "Java"
                          [1] =&gt; "Oracle"
                          [2] =&gt; "PHP"
                      )
              )
      )
  </code></pre>
  
  <p>I have to get the results of the following query.</p>
  
  <p>The Users which are using "OS" as "Windows" and "Softwares" as "Java". How to map these data and query?</p>
  
  <p>Below is the Mapping JSON:</p>
  
  <pre><code>{
  "response": {
    "properties": {
      "profile_id" : {"type" : "long"},
      "timestamp" : {"type" : "string"},
      "parameters" : {
          "type": "nested",
        "properties":{
          "param_id":{"type": "string"},
          "param_values": {             
                "type": "string"                                            
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Below is my Query JSON:</p>
  
  <pre><code>{   "query": {
    "filtered": {
       "query": {
          "match_all": {}
       },
       "filter": {
          "bool": {
             "must": [
                {
                   "nested": {
                      "path": "parameters",
                      "query": {
                         "bool": {
                            "must": [
                               {
                                  "term": {
                                     "parameters.param_id": "Softwares"
                                  }
                               },
                               {
                                  "term": {
                                     "parameters.param_values": "Java"
                                  }
                               }
                            ]
                         }
                      }
                   }
                }
             ]
          }
       }
    }   }}
  </code></pre>