Can you elaborate on what kind of result you want to store?
"Storing results of analysis" is what Lucene does by default, it creates a token stream, and "returning the result" is done what is known as matching queries with the index and retrieving document content from
Note, for ES working properly, you need to assure an unmodified
_source which is kept throughout the indexing process. So you are correct, the best method to add hidden data to the index is by creating extra fields with attribute
store: true, which may be created dynamically ( or not).
The mechanism ES provides to process field content is called field mapper. That means, you can create a plugin that controls a custom field type.
Instead of indexing just a string or number, you can index whatever you want from the input, and under which field name you want.
copy_to is just a builtin mechanism for selecting a field name, so there is no need to reinvent the wheel.
For example, the atttachments field mapper is part of Elasticsearch distribution. It can be studied how metadata is indexed alongside binary files: https://github.com/elastic/elasticsearch/tree/master/plugins/mapper-attachments
Another example, while field mapping, it is possible to detect the language and index just the language code instead of the original text. See my lang detect plugin at https://github.com/jprante/elasticsearch-langdetect/