title: Elasticsearch nested mapping query not working- JAVA?
body: <p>I've set my one field to nested type. 
  I followed as per this documentation <a href="https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-joining-queries.html#java-query-dsl-nested-query" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-joining-queries.html#java-query-dsl-nested-query</a></p>
  
  <p>Below is the snippet </p>
  
  <pre><code>"price":{  
             "type":"nested",
             "properties":{  
                "activity_price":{  
                   "type":"double"
                },
                "multimedia_price":{  
                   "type":"double"
                },
                "transportation_price":{  
                   "type":"double"
                }
             }
          }
  </code></pre>
  
  <p>While performing query </p>
  
  <pre><code>QueryBuilders.nestedQuery("price", QueryBuilders.boolQuery()
          .must(QueryBuilders.matchQuery("price.activity_price", price)),
              ScoreMode.Max);
  </code></pre>
  
  <p>I get [nested] nested object under path [price] is not of nested type.</p>
  
  <p>I'm using Elasticsearch 5.1.2</p>
  
  <p><strong><em>I've three files to create index,mappings and to populate data:-</em></strong>
  <strong>mapping.json</strong></p>
  
  <pre><code>{  
     "settings":{  
        "number_of_shards":1,
        "number_of_replicas":0
     },
     "mappings":{  
        "test_type_table":{  
           "price":{  
              "type":"nested",
              "properties":{  
                 "activity_price":{  
                    "type":"double"
                 },
                 "multimedia_price":{  
                    "type":"double"
                 },
                 "transportation_price":{  
                    "type":"double"
                 }
              }
           }
        }
     }
  }
  </code></pre>
  
  <p><strong>data.json</strong></p>
  
  <pre><code>{ "index" : { "_index" : "test_index", "_type" : "test_type_table", "_id" : "1" } }
  {"price": [{"activity_price":"100.00","multimedia_price":"10","transporation_price":"10"}]}
  </code></pre>
  
  <p>and <strong>setup.json</strong></p>
  
  <pre><code>curl -XPOST http://localhost:9200/test_index -d @mapping.json
  curl -s -XPOST http://localhost:9200/_bulk --data-binary @data.json
  </code></pre>