toastdriven/django-haystack — pull request #963 by rciorba (2014-03-03 20:42:30+00:00)
Title: Fix handling of 'stored=False' for elasticsearch

Motivation: we noticed very large response size from Elasticsearch, despite using `stored=False` on certain fields.

Changes:
* change `build_schema` to handle excluded attributes list for `_source` field
* set `stored=False` by default for auto_generated `*_exact` fields (affects all backends)
* add tests for new functionality
* update existing tests to reflect changes to schema generation

Downsides:
* this changes the signature of build_schema for the ES backend, and that might break things for people subclassing ElasticsearchBackend to provide customized mappings
* setting `stored=False` for `*_exact` fields seems to me like the right thing to do, but there might be people expecting to get that value back in responses

Suggestions and feedback are welcome!