How to create Nested field in index using Elasticsearch Java Client 8

54 Views Asked by At

I have an ES index that is created from Java code level when I index a POJO with ElasticsearchClient.

How do I specify that I need certain fields to be type: "nested" in my index?

1

There are 1 best solutions below

0
On

You can specify your nested attribute with annotation @Field:

@Field(type = FieldType.Nested)