mozilla/kitsune — pull request #1594 by mythmon (2013-08-30 22:17:47+00:00)
Title: [Bug 906992] Set up multiple ES index framework.

This is my proposal for how we can do multiple ES indexes. For most purposes, all indexes are treated the same, except for a few cases where we preserve the default index, as (currently) that is where important things are stored. This could be used to make an ES index of users that we can delete and reindex separately from the main ES index.

With this set of changes, `settings.py` can contain multiple indexes in `ES_INDEXES` and/or `ES_WRITE_INDEXES`, and models can choose which kind of index to use. The admin and management commands have been updated, and I updated search and other parts of the site that use elastic to account for multiple indexes, where needed.

Being sure this really works can be hard, since nothing is actually using the other indexes. So I made [another branch](https://github.com/mythmon/kitsune/tree/test-moar-indexes) that moves wiki documents to a secondary index in ES. To test this, you can delete all your ES indexes (`curl -XDELETE localhost:9200/sumo_sumo-20130808`), apply the patch, reindex via management commands or the admin, and poke around in the ES management commands, the admin, search or whatever else should work. I also recommend using something like [ES Paramedic](https://github.com/karmi/elasticsearch-paramedic) or [ES Inquisitor](https://github.com/polyfractal/elasticsearch-inquisitor) to get more information about the indexes and documents.

I'm not sure this makes sense to land until we have something that actually uses extra indexes, but on the other hand waiting to land it just makes us less sure about the code as things change. I could go either way.

r?