11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

every shard that it knows about, even if it can not communicate with ZooKeeper at the time it receives the<br />

request. This is normally the preferred behavior from a fault tolerance standpoint, but may result in stale or<br />

incorrect results if there have been major changes to the collection structure that the node has not been informed<br />

of via ZooKeeper (ie: shards may have been added or removed, or split into sub-shards)<br />

A zkConnected header is included in every search response indicating if the node that processed the request<br />

was connected with ZooKeeper at the time:<br />

<strong>Solr</strong> Response with partialResults<br />

{<br />

}<br />

"responseHeader": {<br />

"status": 0,<br />

"zkConnected": true,<br />

"QTime": 20,<br />

"params": {<br />

"q": "*:*"<br />

}<br />

},<br />

"response": {<br />

"numFound": 107,<br />

"start": 0,<br />

"docs": [ ... ]<br />

}<br />

shards.tolerant<br />

In the event that one or more shards queried are completely unavailable, then <strong>Solr</strong>'s default behavior is to fail the<br />

request. However, there are many use-cases where partial results are acceptable and so <strong>Solr</strong> provides a<br />

boolean shards.tolerant parameter (default ' false'). If shards.tolerant=true then partial results may<br />

be returned. If the returned response does not contain results from all the appropriate shards then the response<br />

header contains a special flag called ' partialResults'. The client can specify ' shards.info' along with the '<br />

shards.tolerant' parameter to retrieve more fine-grained details.<br />

Example response with partialResults flag set to 'true':<br />

<strong>Solr</strong> Response with partialResults<br />

{<br />

}<br />

"responseHeader": {<br />

"status": 0,<br />

"zkConnected": true,<br />

"partialResults": true,<br />

"QTime": 20,<br />

"params": {<br />

"q": "*:*"<br />

}<br />

},<br />

"response": {<br />

"numFound": 77,<br />

"start": 0,<br />

"docs": [ ... ]<br />

}<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

554

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!