Ошибка при индексировании документа, Cannot change object mapping from nested to non-nested

Пытаюсь переписать старый Elasticsearch 5.x код индексирования документа для Elasticsearch 7.1

Старая версия:

    $this->client->indices()->create([
        'index' => 'shop',
        'body' => [
            'mappings' => [
                'products' => [
                    '_source' => [
                        'enabled' => true,
                    ],
                    'properties' => [
                        'id' => [
                            'type' => 'integer',
                        ],
                        'name' => [
                            'type' => 'text',
                        ],
                        'description' => [
                            'type' => 'text',
                        ],
                        'price' => [
                            'type' => 'integer',
                        ],
                        'rating' => [
                            'type' => 'float',
                        ],
                        'brand' => [
                            'type' => 'integer',
                        ],
                        'categories' => [
                            'type' => 'integer',
                        ],
                        'tags' => [
                            'type' => 'integer',
                        ],
                        'values' => [
                            'type' => 'nested',
                            'properties' => [
                                'characteristic' => [
                                    'type' => 'integer'
                                ],
                                'value_string' => [
                                    'type' => 'keyword',
                                ],
                                'value_int' => [
                                    'type' => 'integer',
                                ],
                            ]
                        ]
                    ]
                ]
            ]
        ]
    ]);

Новая версия, до чего смог дойти убирая другие ошибки.:

$this->client->indices()->create([
        'index' => 'shop',
        'body' => [
            'mappings' => [
                '_source' => [
                    'enabled' => true,
                ],
                'properties' => [
                    'id' => [
                        'type' => 'long',
                    ],
                    'name' => [
                        'type' => 'text',
                    ],
                    'description' => [
                        'type' => 'text',
                    ],
                    'price' => [
                        'type' => 'long',
                    ],
                    'rating' => [
                        'type' => 'float',
                    ],
                    'brand' => [
                        'type' => 'long',
                    ],
                    'categories' => [
                        'type' => 'long',
                    ],
                    'tags' => [
                        'type' => 'long',
                    ],
                    'values' => [
                        'type' => 'nested',
                        'properties' => [
                            'characteristic' => [
                                'type' => 'long',
                            ],
                            'value_string' => [
                                'type' => 'text',
                            ],
                            'value_int' => [
                                'type' => 'long',
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ]);

Данные которые пытаюсь проиндексировать:

    [
    'index' => 'shop'
    'type' => 'products'
    'id' => 1
    'body' => [
        'id' => 1
        'name' => 'Товар 1'
        'description' => 'Это не сон, это сони'
        'price' => 100
        'rating' => 0
        'brand' => 2
        'categories' => [
            0 => 2
            1 => 1
            2 => 4
            3 => 1
            4 => 2
        ]
        'tags' => [
            0 => 2
        ]
        'values' => [
            0 => [
                'characteristic' => 1
                'value_string' => 'White'
                'value_int' => 0
            ]
            1 => [
                'characteristic' => 2
                'value_string' => '10'
                'value_int' => 10
            ]
        ]
    ]
]

P.S. Не судите строго, делаю первые шаги в Elasticsearch


Ответы (0 шт):