# Bulk API with nested mapping (non DSL)

**URL:** <https://discuss.elastic.co/t/bulk-api-with-nested-mapping-non-dsl/120384>\
**Category:** Elasticsearch\
**Created:** [February 19, 2018, 1:52am UTC](https://discuss.elastic.co/t/bulk-api-with-nested-mapping-non-dsl/120384 "2018-02-19T01:52:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![druzmieres](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/druzmieres/32/25828_2.png) [@druzmieres](https://discuss.elastic.co/u/druzmieres)\
**Post date:** [February 19, 2018, 1:52am UTC](https://discuss.elastic.co/t/bulk-api-with-nested-mapping-non-dsl/120384/1 "2018-02-19T01:52:18Z")

</div>

I wrote a script to load data to an elasticsearch instance using bulk helpers. It works great with simple mappings like this one:

```
{
    "mappings": {
        "*": {
            "properties": {
                "id": {"type": "long"},
                "description": {"type": "text"},
                "active": {"type": "boolean"}
            }
        }
    }
}

```

But when I try using a nested mapping, it doesn't work right.

I have a data file with this header `route|startDate|segmentStart|longitude|latitude` (`'|'` is the delimiter) and this mapping:

```
{
  "mappings": {
    "*": {
      "properties": {
        "route" : {"type": "text"},
        "startDate" : {"type": "date"},
        "points": {
          "properties": {
            "segmentStart": {"type": "integer"},
            "longitude": {"type": "float"},
            "latitude": {"type": "float"}
          }
        }
      }
    }
  }
}

```

As you can see "points" has three properties "longitude", "latitude" and "segmentStart". But the mapping I see after uploading the data is this one:

```
{
  "shape": {
    "mappings": {
      "*": {
        "properties": {
          "latitude": {"type": "text", "fields": {"keyword": {"type": "keyword", "ignore_above": 256}}},
          "longitude": {"type": "text", "fields": {"keyword": {"type": "keyword", "ignore_above": 256}}},
          "points": {
            "properties": {
              "latitude": {"type": "float"},
              "longitude": {"type": "float"},
              "segmentStart": {"type": "integer"}
            }
          },
          "route": {"type": "text"},
          "segmentStart": {"type": "text", "fields": {"keyword": {"type": "keyword", "ignore_above": 256}}},
          "startDate": {"type": "date"}
        }
      }
    }
  }
}

```

And the data is clearly not uploaded in the way I need. Any ideas about what could be wrong?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 19, 2018, 1:52am UTC](https://discuss.elastic.co/t/bulk-api-with-nested-mapping-non-dsl/120384/2 "2018-03-19T01:52:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
