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.

etagSeed This value of this attribute is sent as the value of the ETag header. Changing this value can be<br />

helpful to force clients to re-fetch content even when the indexes have not changed---for<br />

example, when you've made some changes to the configuration.<br />

<br />

max-age=30, public<br />

<br />

cacheControl Element<br />

In addition to these attributes, accepts one child element: . The content of<br />

this element will be sent as the value of the Cache-Control header on HTTP responses. This header is used to<br />

modify the default caching behavior of the requesting client. The possible values for the Cache-Control header<br />

are defined by the HTTP 1.1 specification in Section 14.9.<br />

Setting the max-age field controls how long a client may re-use a cached response before requesting it again<br />

from the server. This time interval should be set according to how often you update your index and whether or<br />

not it is acceptable for your application to use content that is somewhat out of date. Setting must-revalidate<br />

will tell the client to validate with the server that its cached copy is still good before re-using it. This will ensure<br />

that the most timely result is used, while avoiding a second fetch of the content if it isn't needed, at the cost of a<br />

request to the server to do the check.<br />

Update Request Processors<br />

Every update request received by <strong>Solr</strong> is run through a chain of plugins known as Update Request Processor.<br />

This can be useful, for example, to add a field to the document being indexed or to change the value of a<br />

particular field or to drop an update if the incoming document doesn't fulfill certain criteria. In fact, a surprisingly<br />

large number of features in <strong>Solr</strong> are implemented as Update Processors and therefore it is necessary to<br />

understand how such plugins work and where are they configured.<br />

Topics in this section:<br />

Anatomy and life cycle<br />

Configuration<br />

Update processors in <strong>Solr</strong>Cloud<br />

Using custom chains<br />

Update Request Processor Factories<br />

Anatomy and life cycle<br />

An Update Request Processor is created as part of a chain of one or more update processors. <strong>Solr</strong> creates a<br />

default update request processor chain comprising of a few update request processors which enable essential<br />

<strong>Solr</strong> features. This default chain is used to process every update request unless a user chooses to configure and<br />

specify a different custom update request processor chain.<br />

The easiest way to describe an Update Request Processor is to look at the Javadocs of the abstract class Updat<br />

eRequestProcessor. Every UpdateRequestProcessor must have a corresponding factory class which extends Up<br />

dateRequestProcessorFactory. This factory class is used by <strong>Solr</strong> to create a new instance of this plugin. Such a<br />

design provides two benefits:<br />

1.<br />

2.<br />

An update request processor need not be thread safe because it is used by one and only one request<br />

thread and destroyed once the request is complete.<br />

The factory class can accept configuration parameters and maintain any state that may be<br />

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

458

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

Saved successfully!

Ooh no, something went wrong!