Elastic SearchSearch API - default_allow_partial_results parameter

I am working on a project and looking at ES documentation I found a query parameter allow_partial_search_results.

(Optional, Boolean) If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results. Defaults to true.

To override the default for this field, set the search.default_allow_partial_results cluster setting to false.

The documentation shows that setting it false it will returns an error "with no partial results".

But I don't know how is that return. Do anyone knows if the returning error format is like ES internal error format?

{ 'took' => , 'timed_out' => false, '_shards' => { 'total' => , 'successful' => , 'skipped' => 0, 'failed' => 1, 'failures' => [{ 'shard' => 35, 'index' => 'value_index_20210622', 'node' => '', 'reason' => { 'type' => '', 'reason' => ] disconnected' } }] }, 'hits' => { 'total' => 0, 'max_score'=> 0, 'hits' => } } }

Or it returns an exception?

Anyone has an implemented example how to catch the error for proper treatment?

Thank you everyone

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