Book Image

Solr Cookbook - Third Edition

By : Rafal Kuc
Book Image

Solr Cookbook - Third Edition

By: Rafal Kuc

Overview of this book

Table of Contents (18 chapters)
Solr Cookbook Third Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

SolrCloud read-side fault tolerance


When a single shard from your collection fails to respond to the query, Solr will fail the whole request. This is good for most use cases, but not for all. Sometimes, you might like to show partial results so that your users can see at least some portion of the results. By default, this is not possible, but luckily Solr allows you to adapt to its behavior when it comes to such situations on per request basis. This recipe will show you how to force Solr to return even partial results.

Getting ready

We assume that we already have a running SolrCloud cluster with two nodes and a collection created with two leader shards and no replica. If you don't know how to do this, refer to the Creating a new SolrCloud cluster recipe in Chapter 7, In the Cloud. This recipe will show you how to create a new SolrCloud cluster and create a collection.

How to do it...

We indexed four sample documents to our Solr cluster. Two documents are placed in one shard and the other two...