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.

only three fields in the initial schema: id , _version_, and _text_.<br />

You can use the /schema/fields Schema API to confirm this: curl http://localhost:8983/solr/get<br />

tingstarted/schema/fields will output:<br />

{<br />

"responseHeader":{<br />

"status":0,<br />

"QTime":1},<br />

"fields":[{<br />

"name":"_text_",<br />

"type":"text_general",<br />

"multiValued":true,<br />

"indexed":true,<br />

"stored":false},<br />

{<br />

"name":"_version_",<br />

"type":"long",<br />

"indexed":true,<br />

"stored":true},<br />

{<br />

"name":"id",<br />

"type":"string",<br />

"multiValued":false,<br />

"indexed":true,<br />

"required":true,<br />

"stored":true,<br />

"uniqueKey":true}]}<br />

Because the data_driven_schema_configs config set includes a copyField directive that causes<br />

all content to be indexed in a predefined "catch-all" _text_ field, to enable single-field search that<br />

includes all fields' content, the index will be larger than it would be without the copyField. When you<br />

nail down your schema, consider removing the _text_ field and the corresponding copyField directiv<br />

e if you don't need it.<br />

Configuring Schemaless Mode<br />

As described above, there are three configuration elements that need to be in place to use <strong>Solr</strong> in schemaless<br />

mode. In the data_driven_schema_configs config set included with <strong>Solr</strong> these are already configured. If,<br />

however, you would like to implement schemaless on your own, you should make the following changes.<br />

Enable Managed Schema<br />

As described in the section Schema Factory Definition in <strong>Solr</strong>Config, Managed Schema support is enabled by<br />

default, unless your configuration specifies that ClassicIndexSchemaFactory should be used.<br />

You can configure the ManagedIndexSchemaFactory (and control the resource file used, or disable future<br />

modifications) by adding an explicit like the one below, please see Schema Factory<br />

Definition in <strong>Solr</strong>Config for more details on the options available.<br />

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

98

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

Saved successfully!

Ooh no, something went wrong!