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

Models should be in separate indices #34

Closed
hipsterjazzbo opened this issue Oct 24, 2016 · 3 comments
Closed

Models should be in separate indices #34

hipsterjazzbo opened this issue Oct 24, 2016 · 3 comments

Comments

@hipsterjazzbo
Copy link
Contributor

According to this page, one shouldn't mix different types of data in a single index. By default, Plastic stores all models in a single index, and differentiates based on type.

However, the underlying Lucene instance flattens out all mappings, causing conflict issues like #31. I have also started to run into issues like this.

Totally understanding how big a change this would be, I reckon we should think about changing this package to use separate indices for each model type by default. I'd be happy to tackle the work and open a PR.

Thoughts?

@hipsterjazzbo hipsterjazzbo changed the title Models should be in separate indices? Models should be in separate indices Oct 24, 2016
@tobias-kuendig
Copy link
Contributor

This is exactly the problem I tried to solve with the inIndex method that was added to the search builder and persistance layer.

According to this page it depends highly on your use case whether or not you should store every model in a different index or use types instead.

I suggest adding something like an elasticIndex property to every model that allows you to overwrite the default index specified in the config on a per model basis.

With the inIndex methods in place (after merge of PR #33) this shouldn't be too complicated to accomplish.

@hipsterjazzbo
Copy link
Contributor Author

Yeah. I still think though, that for eloquent models in particular, each should be in it's own index by default. That could probably happen in the EloquentPersistence class and a few other places.

@sleimanx2
Copy link
Owner

Done in v0.2.5 , also added custom index for suggestion and mapping

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

No branches or pull requests

3 participants