Every man and his own business requirements and SLAs. Many scenarios I've seen would consider two-thirds of shards responding as an OK scenario and not even show a notice about results being partial. But of course it makes sense to throw an exception if your business requires / expects that.
FWIW, this is usually why you use replicas, so even if a shard goes down there's a back-up shard (ideally more than one) that you can fallback to. -- Itamar Syn-Hershko http://code972.com | @synhershko <https://twitter.com/synhershko> Freelance Developer & Consultant Author of RavenDB in Action <http://manning.com/synhershko/> On Wed, Jun 18, 2014 at 12:45 PM, mooky <nick.minute...@gmail.com> wrote: > If I understand correctly, we can get an OK response from elastic (ie no > error) but if there are shard failures in the response, it potentially > means that results are incomplete/incorrect. From my observation, we can > get failures on all shards - and elastic still returns OK (which was a bit > surprising to me) > > What kinds of approaches to people typically use to deal with shard > failures? > > For my application, if there are shard failures, essentially my results > are inaccurate/incorrect - so I need to return an error to the client. > Returning bad results is worse than returning an error. > > I am inclined to turn any shard failure into an exception. > Is this quite common? Does it make sense to add a feature to the elastic > api ? (ie request.setTreatShardFailuresAsErrors(true) > > -- > You received this message because you are subscribed to the Google Groups > "elasticsearch" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to elasticsearch+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/461fa217-d664-47e9-a60d-88ea9506327d%40googlegroups.com > <https://groups.google.com/d/msgid/elasticsearch/461fa217-d664-47e9-a60d-88ea9506327d%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zu7ECzf7bA_YG0XoGaVrPr1CUyKzhq1VRn4XD47CH%2B0MQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.