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.

ext_dfr , as well as any fields using a type that does not explicitly specify a .<br />

If SchemaSimilarityFactory is explicitly declared with out configuring a defaultSimFromFieldType,<br />

then BM25Similarity is implicitly used as the default.<br />

In addition to the various factories mentioned on this page, there are several other similarity implementations that<br />

can be used such as the SweetSpotSimilarityFactory, ClassicSimilarityFactory, etc.... For details,<br />

see the <strong>Solr</strong> Javadocs for the similarity factories.<br />

Schema API<br />

The Schema API provides read and write access to the <strong>Solr</strong> schema for each collection (or core, when using<br />

standalone <strong>Solr</strong>). Read access to all schema elements is supported. Fields, dynamic fields, field types and<br />

copyField rules may be added, removed or replaced. Future <strong>Solr</strong> releases will extend write access to allow more<br />

schema elements to be modified.<br />

Re-index after schema modifications!<br />

If you modify your schema, you will likely need to re-index all documents. If you do not, you may lose<br />

access to documents, or not be able to interpret them properly, e.g. after replacing a field type.<br />

Modifying your schema will never modify any documents that are already indexed. Again, you must<br />

re-index documents in order to apply schema changes to them.<br />

To enable schema modification with this API, the schema will need to be managed and mutable. See the section<br />

Schema Factory Definition in <strong>Solr</strong>Config for more information.<br />

The API allows two output modes for all calls: JSON or XML. When requesting the complete schema, there is<br />

another output mode which is XML modeled after the schema.xml file itself.<br />

When modifying the schema with the API, a core reload will automatically occur in order for the changes to be<br />

available immediately for documents indexed thereafter. Previously indexed documents will not be automatically<br />

handled - they must be re-indexed if they used schema elements that you changed.<br />

The base address for the API is http://:/solr/ . If for example you<br />

run <strong>Solr</strong>'s " cloud" example (via the bin/solr command shown below), which creates a " gettingstarted"<br />

collection, then the base URL (as in all the sample URLs in this section) would be: http://localhost:8983/<br />

solr/gettingstarted .<br />

bin/solr -e cloud -noprompt<br />

API Entry Points<br />

Modify the Schema<br />

Add a New Field<br />

Delete a Field<br />

Replace a Field<br />

Add a Dynamic Field Rule<br />

Delete a Dynamic Field Rule<br />

Replace a Dynamic Field Rule<br />

Add a New Field Type<br />

Delete a Field Type<br />

Replace a Field Type<br />

Add a New Copy Field Rule<br />

Delete a Copy Field Rule<br />

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

72

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

Saved successfully!

Ooh no, something went wrong!