# Document is not saved

**URL:** <https://discuss.elastic.co/t/document-is-not-saved/321976>\
**Category:** Elasticsearch\
**Created:** [December 26, 2022, 8:18am UTC](https://discuss.elastic.co/t/document-is-not-saved/321976 "2022-12-26T08:18:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave3](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dave3](https://discuss.elastic.co/u/dave3)\
**Post date:** [December 26, 2022, 8:18am UTC](https://discuss.elastic.co/t/document-is-not-saved/321976/1 "2022-12-26T08:18:59Z")

</div>

I have created a documet with many fields, some of them are lists of Strings as follows:

```auto
@Field(type = FieldType.Nested)
private Set<String> locationList = new HashSet<>();

```

but when I try to save this document, i get this error:

> 2022-12-23 14:20:43.049 ERROR 182080 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path threw exception [Request processing failed; nested exception is org.springframework.data.elasticsearch.UncategorizedElasticsearchException: Elasticsearch exception [type=mapper\_parsing\_exception, reason=object mapping for [locationList] tried to parse field [null] as object, but found a concrete value]; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=mapper\_parsing\_exception, reason=object mapping for [locationList] tried to parse field [null] as object, but found a concrete value]]] with root cause org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=mapper\_parsing\_exception, reason=object mapping for [locationList] tried to parse field [null] as object, but found a concrete value]

I tried to change all these fields to Text like this:

```auto
@Field(type = FieldType.Text)
private Set<String> locationList = new HashSet<>();

```

there were no more errors after this, but the document was not saved in the index. Before that I even deleted the old index so that a new index with new mappings will be created.

does anyone knows what could be the problem? Thanks.

---

<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:** [January 23, 2023, 8:19am UTC](https://discuss.elastic.co/t/document-is-not-saved/321976/2 "2023-01-23T08:19:27Z")

</div>

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