Defining a mapping for join datatype - Java API

Hi,

I migration from old ES version to newest 6.2.2.

Right now I want to migrate from _parent to join using Java API:

           XContentBuilder documentMapping = jsonBuilder()
            .startObject()
                .startObject("properties")
                    .startObject("join_field")
                        .field("type", "join")
                        .startObject("relations")
                            .field("entry", "comment")
                        .endObject()
                    .endObject()
                .endObject()
            .endObject();

Unfortunately I got a exception:

Exception in thread "main" MapperParsingException[Failed to parse mapping [_doc]: No handler for type [join] declared on field [join_field]]; nested: MapperParsingException[No handler for type [join] declared on field [join_field]];

Probably this type is not added yet do Java API?

I found something like parent-join-client, but I don't know how to use it.

Looks strange to me as this is evaluated on server side.

Are you sure you are joining a 6.2 cluster?

Yes:

<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>6.2.2</version>
</dependency>
<dependency>
    <groupId>org.elasticsearch.plugin</groupId>
    <artifactId>transport-netty4-client</artifactId>
    <version>6.2.2</version>
</dependency>

That's the client side. I mean the server?

What gives a

GET /

?

I use not support embedded version:

classpathPlugins.add(Netty4Plugin.class);

Node node = new MyNode(
        Settings.builder()
                .put("transport.type", "netty4")
                .put("http.type", "netty4")
                .put("http.enabled", "true")
                .put("path.home", "elasticsearch-data")
                .build(),
        classpathPlugins);

We don't support embedded nodes.
So that is not going to work.

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