I am wondering if it is possible to return virtual fields somehow in an elasticsearch query, via arguments or the document mapping.
Currently I am trying to use elasticsearch-langdetect plugin for the detection of content languages. It creates subfields that contain the language of the documents. What I want to do is query the documents again and index them in another elasticsearch index, that is language specific, without inserting any documents in any language specific index twice.
In all the examples, the detected language is only queried, never returned.
How can non stored properties, that are not in the original document, be returned via elasticsearch search results? Or is that not possible in elasticsearch. I have searched the documentation, and only found the fields, script_fields and field_data fields, that all do something else and work AFAIK only on stored fields.
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-fields.html
Can I store fields that are calculated from the source data?