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.

Javadocs for update processor factories mentioned above:<br />

UUIDUpdateProcessorFactory<br />

RemoveBlankFieldUpdateProcessorFactory<br />

FieldNameMutatingUpdateProcessorFactory<br />

ParseBooleanFieldUpdateProcessorFactory<br />

ParseLongFieldUpdateProcessorFactory<br />

ParseDoubleFieldUpdateProcessorFactory<br />

ParseDateFieldUpdateProcessorFactory<br />

AddSchemaFieldsUpdateProcessorFactory<br />

Make the UpdateRequestProcessorChain the Default for the UpdateRequestHandler<br />

Once the UpdateRequestProcessorChain has been defined, you must instruct your UpdateRequestHandlers to<br />

use it when working with index updates (i.e., adding, removing, replacing documents). Here is an example using<br />

InitParams to set the defaults on all /update request handlers:<br />

<br />

<br />

add-unknown-fields-to-the-schema<br />

<br />

<br />

After each of these changes have been made, <strong>Solr</strong> should be restarted (or, you can reload the cores to<br />

load the new solrconfig.xml definitions).<br />

Examples of Indexed Documents<br />

Once the schemaless mode has been enabled (whether you configured it manually or are using data_driven_<br />

schema_configs ), documents that include fields that are not defined in your schema should be added to the<br />

index, and the new fields added to the schema.<br />

For example, adding a CSV document will cause its fields that are not in the schema to be added, with<br />

fieldTypes based on values:<br />

curl "http://localhost:8983/solr/gettingstarted/update?commit=true" -H<br />

"Content-type:application/csv" -d '<br />

id,Artist,Album,Released,Rating,FromDistributor,Sold<br />

44C,Old Shews,Mead for Walking,1988-08-13,0.01,14,0'<br />

Output indicating success:<br />

<br />

0106<br />

<br />

The fields now in the schema (output from curl http://localhost:8983/solr/gettingstarted/sche<br />

ma/fields ):<br />

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

101

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

Saved successfully!

Ooh no, something went wrong!