elastic search 5.1 why stored_fields does not return asked field? elastic search 5.1 why stored_fields does not return asked field? elasticsearch elasticsearch

elastic search 5.1 why stored_fields does not return asked field?


By default, the document fields are not stored, i.e. in your mapping you don't specify store: true for each of them.

Hence, "stored_fields": ["first_name"] will not be able to return the first_name field since it's not stored.

You can use source filtering instead and specify "_source": ["first_name"] in your query, that will work.