Document is not saved

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

@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:

@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.

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