_search request. Get only objects / elements inside hits?

Hi,

I want to query elasticsearch for exporting a subset of data to be able to import it into a separate elasticsearch instance, which is not connected. Also I need to export as plain text, that the exporter is able to double check data and to render personal data anonymous manually.

The output response for the _search looks like the following:
image

I want only to have the objects inside hits. I assume that I can just feed these objects to logstash for importing into the other instance.

Is there any option that elasticsearch is just delivering these array elements, or do I need to post process the results to only return the hits' entries?

Thanks, Andreas

Postprocessing is the way to go here, you can use filter_path to only return the hits.hits data structure, but you cannot change the structure and move fields around within Elasticsearch.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.