Skip to content

Conversation

guram-vashakidze
Copy link
Contributor

@pdphilip hello,

thank you merge my previous PR. I faced one issue in insert flow. For example my index has next mapping:

'field_foo' => [
    'type' => 'text'
],
'field_bar' => [
    'type' => 'text'
],

If I insert in this way:

$index = new MyIndexModel();
$index->fill(['field_bar' => 'Bar value', 'field_foo' => ['Foo value 1', 'Foo value 2']])->save();

It works. But if I use next way:

$index = new MyIndexModel();
$index->fill(['field_foo' => ['Foo value 1', 'Foo value 2'], 'field_bar' => 'Bar value'])->save();

It doesn't work, because first value is array and current insert starts use every value like independent inserted doc.
I changed it to check array_is_list - looks it solved the issue. There is I see just one problem - this function appeared after PHP 8.0, but I saw that last version of your lib supports Laravel upper then 10.0 (which needed PHP 8.0+)

@guram-vashakidze guram-vashakidze marked this pull request as draft April 4, 2025 07:20
@guram-vashakidze guram-vashakidze marked this pull request as ready for review April 4, 2025 07:20
@pdphilip pdphilip merged commit 3afb035 into pdphilip:main Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants