Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing meta-field to use join datatype #90

Closed
burakcakirel opened this issue Mar 5, 2020 · 2 comments
Closed

Routing meta-field to use join datatype #90

burakcakirel opened this issue Mar 5, 2020 · 2 comments
Assignees

Comments

@burakcakirel
Copy link
Contributor

Need to add Routing meta-field to be able to use join datatype.
https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-routing-field.html
https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html#CO163-1

Here is the quick solution by adding the following line after https://github.com/matchish/laravel-scout-elasticsearch/blob/v3.0.1/src/ElasticSearch/Params/Bulk.php#L49
https://github.com/matchish/laravel-scout-elasticsearch/blob/v3.0.1/src/ElasticSearch/Params/Bulk.php#L69

'routing' => false === empty($model->routing) ? $model->routing : $model->getScoutKey(),

So, we can define an accessor in our models:
https://laravel.com/docs/6.x/eloquent-mutators#defining-an-accessor

Any ideas? I'm ready to open a PR.

@matchish
Copy link
Owner

matchish commented Mar 6, 2020

Thanks for the help! Looking forward to your quick solution implementation.

@matchish
Copy link
Owner

matchish commented Mar 6, 2020

And could you please add TODO comment Add ability to extend payload without modifying the class? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants