-
Notifications
You must be signed in to change notification settings - Fork 43
get index or create it with the model primary key if not exist #41
get index or create it with the model primary key if not exist #41
Conversation
Hey @shokme Also, is the primary key optionnal ? Could you add a test without any primary key given? |
By default Laravel will set a But, should we keep the possibility to create an index by using the cli ? php artisan scout:index name -k optionalKey if we are able to handle it automatically, I don't see this cli useful anymore (even If we have to keep a part of it to delete an index). |
Ah yes, redundant tests are bad, you are right.
MeiliSearch infers the
Does this mean that if I create a index with the laravel-scout it will enforce
I'm not enough aware of the use case of this SDK, I prefer waiting on @curquiza opinion on this |
@bidoubiwa I think Meilisearch must not infer the ID in this case, it should use Laravel $primaryKey, which can or cannot include the string "id". |
it will be less error prone to let laravel handle the PK of meilisearch as you can have a PK != *id* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MeiliSearch API will manage the automatic index creation in the future (meilisearch/meilisearch#918), but until the official release, this is a great fix!
Resolve #36