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

[10.x] Provide searchable data array with primary key and value for MeiliSearch #546

Merged
merged 1 commit into from
Nov 11, 2021
Merged

[10.x] Provide searchable data array with primary key and value for MeiliSearch #546

merged 1 commit into from
Nov 11, 2021

Conversation

mmachatschek
Copy link
Contributor

@mmachatschek mmachatschek commented Nov 10, 2021

Since getScoutKeyName() and getScoutKey() return the expected data (#509) we can now build the searchable data ourselves.

This adds consistancy to the already implemented collection engine and Algolia engine that make use of a "predefined" primary key.

Furthermore, this reduces bugs on the implementation side for users that override the toSearchableArray() method and forget to add the primary key.

@taylorotwell
Copy link
Member

Any breaking changes for applications already using MeiliSearch and Scout 9?

@mmachatschek mmachatschek changed the title [10.x] Replicate Algolia data when building the searchable data for MeiliSearch [10.x] Provide searchable data array with primary key and value for MeiliSearch Nov 11, 2021
@mmachatschek
Copy link
Contributor Author

I don't consider this as breaking, because people customizing the toSearchableArray() already need to provide the primary key and value with which the data gets fetched from the database later. The array_merge() will handle duplicate data in the payload that gets sent to MeiliSearch.

I created #547 that fixes it on the 9.x branch with the "incorrect" use of scout key name handling.

@taylorotwell taylorotwell merged commit feff4bb into laravel:master Nov 11, 2021
@mmachatschek mmachatschek deleted the update_searchable_data branch November 11, 2021 14:28
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