11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

...<br />

<br />

<br />

<br />

Special Commands for the Data Import Handler<br />

You can pass special commands to the DIH by adding any of the variables listed below to any row returned by<br />

any component:<br />

$skipDoc<br />

$skipRow<br />

Variable<br />

Description<br />

Skip the current document; that is, do not add it to <strong>Solr</strong>. The value can be the string tru<br />

e|false.<br />

Skip the current row. The document will be added with rows from other entities. The<br />

value can be the string true|false<br />

$docBoost Boost the current document. The boost value can be a number or the toString conve<br />

rsion of a number.<br />

$deleteDocById Delete a document from <strong>Solr</strong> with this ID. The value has to be the uniqueKey value of<br />

the document.<br />

$deleteDocByQuery<br />

Delete documents from <strong>Solr</strong> using this query. The value must be a <strong>Solr</strong> Query.<br />

Updating Parts of Documents<br />

Once you have indexed the content you need in your <strong>Solr</strong> index, you will want to start thinking about your<br />

strategy for dealing with changes to those documents. <strong>Solr</strong> supports two approaches to updating documents that<br />

have only partially changed.<br />

The first is atomic updates. This approach allows changing only one or more fields of a document without having<br />

to re-index the entire document.<br />

The second approach is known as optimistic concurrency or optimistic locking. It is a feature of many NoSQL<br />

databases, and allows conditional updating a document based on its version. This approach includes semantics<br />

and rules for how to deal with version matches or mis-matches.<br />

Atomic Updates and Optimistic Concurrency may be used as independent strategies for managing changes to<br />

documents, or they may be combined: you can use optimistic concurrency to conditionally apply an atomic<br />

update.<br />

Atomic Updates<br />

<strong>Solr</strong> supports several modifiers that atomically update values of a document. This allows updating only specific<br />

fields, which can help speed indexing processes in an environment where speed of index additions is critical to<br />

the application.<br />

To use atomic updates, add a modifier to the field that needs to be updated. The content can be updated, added<br />

to, or incrementally increased if a number.<br />

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

226

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

Saved successfully!

Ooh no, something went wrong!