Skip to content

Commit ce7bce4

Browse files
asevsaimaz
authored andcommitted
_id is optional, if not specified (provided null) elasticsearch will create a random id for that document (#750)
1 parent 80e34ba commit ce7bce4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Service/Json/JsonReader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ protected function readLine()
177177
protected function configureResolver(OptionsResolver $resolver)
178178
{
179179
$resolver
180-
->setRequired(['_id', '_type', '_source'])
181-
->setDefaults(['_score' => null, 'fields' => []])
182-
->addAllowedTypes('_id', ['integer', 'string'])
180+
->setRequired(['_type', '_source'])
181+
->setDefaults(['_id' => null, '_score' => null, 'fields' => []])
182+
->addAllowedTypes('_id', ['integer', 'string', 'null'])
183183
->addAllowedTypes('_type', 'string')
184184
->addAllowedTypes('_source', 'array')
185185
->addAllowedTypes('fields', 'array');

0 commit comments

Comments
 (0)