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.

XML Formatted Index Updates<br />

Index update commands can be sent as XML message to the update handler using Content-type:<br />

application/xml or Content-type: text/xml.<br />

Adding Documents<br />

The XML schema recognized by the update handler for adding documents is very straightforward:<br />

The element introduces one more documents to be added.<br />

The element introduces the fields making up a document.<br />

The element presents the content for a specific field.<br />

For example:<br />

<br />

<br />

Patrick Eagar<br />

Sports<br />

796.35<br />

128<br />

<br />

12.40<br />

Summer of the all-rounder: Test and championship<br />

cricket in England 1982<br />

0002166313<br />

1982<br />

Collins<br />

<br />

<br />

...<br />

<br />

<br />

Each element has certain optional attributes which may be specified.<br />

Command<br />

<br />

<br />

Optional<br />

Parameter<br />

commitWithin=<br />

number<br />

overwrite=bool<br />

ean<br />

Parameter Description<br />

Add the document within the specified number of milliseconds<br />

Default is true. Indicates if the unique key constraints should be checked to<br />

overwrite previous versions of the same document (see below)<br />

boost=float Default is 1.0. Sets a boost value for the document.To learn more about<br />

boosting, see Searching.<br />

boost=float Default is 1.0. Sets a boost value for the field.<br />

If the document schema defines a unique key, then by default an /update operation to add a document will<br />

overwrite (ie: replace) any document in the index with the same unique key. If no unique key has been defined,<br />

indexing performance is somewhat faster, as no check has to be made for an existing documents to replace.<br />

If you have a unique key field, but you feel confident that you can safely bypass the uniqueness check (eg: you<br />

build your indexes in batch, and your indexing code guarantees it never adds the same document more then<br />

once) you can specify the overwrite="false" option when adding your documents.<br />

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

184

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

Saved successfully!

Ooh no, something went wrong!