I have been trying to get the specific fields data from the index that is been provided but getting the error "Unknown key for a START_ARRAY in [fields]".
Unknown key for a START_ARRAY in [fields].
fields: ['snippet.publishedAt']
my expected output out is it should provide the fields array in the hits
You should be using stored_fields
or _source
instead of fields
, i.e.
stored_fields: ['snippet.publishedAt']
or
_source: ['snippet.publishedAt']
UPDATE:
From 7.10 onwards, a new fields features is now available.
For ES7.3 (current version as writing) you can pass a _source
field which can contain a comma separated list of fields.
_source: 'snippet.publishedAt'
You can read more about this here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With