-
Notifications
You must be signed in to change notification settings - Fork 27
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
Allowing different entities indexed into same index #92
Conversation
Thank you so much @codedge for taking care of this repository β€οΈ It seems there are merge conflicts, I will review once the conflicts are done! And sorry for the delay! |
78b6b42
to
f5aa67a
Compare
Fixed |
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.
LGTM! Awesome addition!
bors merge
@codedge, if I understand well, this PR is not breaking for the user? |
Build succeeded: |
Yes, it is not breaking. It even allows more π |
do you really needed to introduce laravel collections (in a Symfony world :D) dependency which pulls up another 2 dependencies only for this? :) |
While this PR got out of control π and poses a bigger rewrite of the tests, it addresses multiple issues.
Passing index names via command line
Passing index name via command line now takes care if the name of the is already prefixed or not. Running
bin/console meili:import --indices=prefix_indexName
bin/console meili:import --indices=indexName
leads to the same index creations which is
prefix_indexName
- given theprefix
hold a value.Indexing different models into the same index
See #90
Although MS supports importing different models into the same index, this was not easiliy possible using this package.
The configuration in
meili_search.yml
would not allowe to set the same index name twice.Now you can do the following
This would lead to the result of having models of
Tag
andLink
inside the very same indextags
.id
, the value of this needs to be unique across both models.@curquiza When the PR is approved and merged this should be documented inside a the wiki.
Using aggregators
See #90
You can now create an aggregator, register your models and will get an aggregated index created in MS. As the identity field of each model is used as identity field in the aggregated index...
@curquiza When the PR is approved and merged this should be documented inside a the wiki.
Fixing inconsistency
See #89
Fixes some left of overs from refatoring
indexName
-> Γ¬ndexUid`. #89 is outdated with this PR here.Further changes
tests/blog.sqlite
. Just use thevar/test.sqlite
folder which already holds cached/runtime data.setUp
method. No need to have a dedicatedrefreshDb
andclearUp
call spread across the test. Each test should be atomic and not relying on former data. So ποΈ everything πphpunit.xml
to the more recent format using the--migrate-configuration
option.Collection
object, seeilluminate/collection
. Makes it a lot easier to deal with, if you ask me π