ongr-io / ElasticsearchBundle

Symfony bundle for Elasticsearch with steroids
MIT License
313 stars 189 forks source link

Problem with routing #975

Closed demianchuk closed 2 years ago

demianchuk commented 3 years ago

Hi, I made next mappings

class Hotels { /**

Than I have hotel object as a parent

/**

and booking as a child

/**

while indexing parent document - all is working

but I am trying to index child document e.g

$booking = new Booking(); $booking->price = 100;

$document = new Hotels(); $document->id = '2'; $document->routing = 1; $document->booking = $booking; $document->hotelBookingsJoinField = ['name' => 'booking_child', 'parent' => 1]; $indexManager = $this->container->get(Hotels::class); $indexManager->persist($document); $indexManager->commit();

message: "{"took":0,"errors":true,"items":[{"index":{"_index":"hotels","_type":"_doc","_id":"1-2","status":400,"error":{"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"illegal_argument_exception","reason":"[routing] is missing for join field [hotel_bookings_join_field]"}}}}]}"

Seems @ES\Routing() is not processed properly but I cant get where is it done at all Can anybody help with that?

demianchuk commented 3 years ago

Seems I found the reason, please check pull request https://github.com/ongr-io/ElasticsearchBundle/pull/976