-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Multiple indexes per model #595
Comments
Unfortunately, this is a non-starter. Haystack (especially in querying) has to be able to know what model to be able to load up & it's very difficult if there isn't a 1-to-1 mapping. One big index is the typical way I recommend handling this case. You have a powerful, (relatively) schemaless data store, so denormalization is your friend. |
Not sure I understand, so we would like 2 indexes in ElasticSearch for the one django model. Doesn't this mean just duplicating the id field in one index into two? I would have thought querying would be fine, but rather writing to the search index would be problematic? |
I got around this using proxy models, Haystack wont complain if you create indexes for them. |
By not supporting this, I believe, it also keeps people from A/B testing different indexing methodologies for a given model. We're revisiting our initial implementation of Haystack and I really wish alongside I agree with the "1 model per index" model, but wish I had more control over routing so I could maintain multiple competing indexes for a given model. |
This is very useful for creating an index per user per model in order to handle object level permissions. |
There are many uses cases for needing multiple indexes for a single model. We had to do this using hacks in our project. +1 to make this a real thing. |
@grjones a fair amount has changed in the last 5 years since this ticket was created. If you have an idea for how this could be implemented, I think it'd be best to open an issue or pull request with a concrete use-case and proposed implementation strategy. |
We have a potential use case where we would like to have multiple indexes per model, and haystack seems to prohibit this at the moment. These indexes would be very different and use different fields etc.
Maybe the solution is to combine into a giant index, however it feels like it would be good to allow multiple indexes per models. Especially when thinking about internal and external tooling.
The text was updated successfully, but these errors were encountered: