Consider disabling storing the `_source` field in our elasticsearch index
In &153 (closed) we're concerned with getting Elasticsearch enabled on GitLab.com . One of the major blockers is the index size.
Per https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html , we currently store a full copy of every document we index in elasticsearch, as well as the original that sits on disk or in the database. We can disable this storage, which should dramatically reduce the index size... although we should check by how much.
Note that the drawbacks are many, particularly in the loss of reindexing and dynamic highlighting. We don't use the former at present (but probably should). The latter, we use at present but the code relating to it on the Ruby side is so complex, I'm not sure we benefit. We might be better off losing the highlighting, or building our own (non-elasticsearch searching would then benefit too).
Since disabling it comes with drawbacks, and for smaller installs the total index size is not a limiting factor, perhaps we can make this a configurable option?