# Object field starting or ending with a \[.\] makes object resolution ambiguous

**URL:** <https://discuss.elastic.co/t/object-field-starting-or-ending-with-a-makes-object-resolution-ambiguous/93921>\
**Category:** Elasticsearch\
**Created:** [July 20, 2017, 11:13am UTC](https://discuss.elastic.co/t/object-field-starting-or-ending-with-a-makes-object-resolution-ambiguous/93921 "2017-07-20T11:13:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PhillippOhlandt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phillippohlandt/32/20279_2.png) [@PhillippOhlandt](https://discuss.elastic.co/u/PhillippOhlandt)\
**Post date:** [July 20, 2017, 11:13am UTC](https://discuss.elastic.co/t/object-field-starting-or-ending-with-a-makes-object-resolution-ambiguous/93921/1 "2017-07-20T11:13:13Z")

</div>

Hey,

I want to index a nested array. It works fine for some of my data, but sometimes I get the error from the title.

The string it complains on (which is an array key):

```auto
Ask Questions\n\nJoin the discussion...\n\n \n\nRichard Wigley\n\nI'm confused about the calling of the length recursion base case: so 'defp length ], count)' vs 'defp\nlength([_|t], count)' and | am assuming that Elixir pattern matches the 'defp length([J, count)' function when\nthe list is empty and pattern matches 'defp length([_]t], count)' when it has an element? I'm throwing in the\nterm 'pattern matching' here but I don't understand it as | am used to functions matching on argument type.\n1 a _ v- Reply - Share\n\nDaniel Berkompas ~» Richard Wigley\n\n& Elixir is different from many programming languages in how it decides which version of a function to\ncall. It calls the first version of a function where the arguments _match_ the pattern in the function\ndefinition. This allows you to be much more specific than a statically typed language. For example, as\nshown in this episode, you can run a given function definition only in the case where the list is empty.\n\nI talk more about this in the previous episode on Control Flow. https://www.learnelixirtw/epi...\n1 m ~ > Reply - Share:

```

Some additional info from the error:

```auto
type: illegal_argument_exception
reason: failed to parse
root_cause: [%{reason: "failed to parse", type: "mapper_parsing_exception"}]
status: 400

```

I am not sure what's wrong. I mean, it's just a string.

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [July 20, 2017, 8:17pm UTC](https://discuss.elastic.co/t/object-field-starting-or-ending-with-a-makes-object-resolution-ambiguous/93921/2 "2017-07-20T20:17:23Z")

</div>

I suspect something isn't being escaped correctly. That exception basically means that a field or object name is starting/ending with a period. So if the string isn't properly escaped for JSON, the parser is interpreting parts of it as the next field/key/name in the JSON object and throwing a fit.

Can you paste the full JSON body that is being sent to ES?

---

<div class="post-metadata">

**Author:** ![PhillippOhlandt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phillippohlandt/32/20279_2.png) [@PhillippOhlandt](https://discuss.elastic.co/u/PhillippOhlandt)\
**Post date:** [July 20, 2017, 8:39pm UTC](https://discuss.elastic.co/t/object-field-starting-or-ending-with-a-makes-object-resolution-ambiguous/93921/3 "2017-07-20T20:39:01Z")

</div>

The posted string is pasted from the error message. There shouldn't be any escaping errors because it's not user-entered and I can successfully dump my dataset to a json file. I can post the full dataset as json tomorrow when I am on my working machine again.

---

<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:** [August 17, 2017, 8:39pm UTC](https://discuss.elastic.co/t/object-field-starting-or-ending-with-a-makes-object-resolution-ambiguous/93921/4 "2017-08-17T20:39:05Z")

</div>

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