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.

faceting 5 true 7 true 7<br />

add multiple<br />

values,<br />

maintaining<br />

order<br />

true<br />

field length<br />

affects doc<br />

score<br />

false<br />

MoreLikeThis<br />

5<br />

true 6<br />

Notes:<br />

1 Recommended but not necessary.<br />

2 Will be used if present, but not necessary.<br />

3 (if termVectors=true)<br />

4 A tokenizer must be defined for the field, but it doesn't need to be indexed.<br />

5 Described in Understanding Analyzers, Tokenizers, and Filters.<br />

6 Term vectors are not mandatory here. If not true, then a stored field is analyzed. So term vectors are<br />

recommended, but only required if stored=false.<br />

7 Either indexed or docValues must be true, but both are not required. DocValues can be more efficient in<br />

many cases.<br />

Defining Fields<br />

Fields are defined in the fields element of schema.xml. Once you have the field types set up, defining the fields<br />

themselves is simple.<br />

Example<br />

The following example defines a field named price with a type named float and a default value of 0.0; the i<br />

ndexed and stored properties are explicitly set to true, while any other properties specified on the float fiel<br />

d type are inherited.<br />

<br />

Field Properties<br />

Property<br />

name<br />

Description<br />

The name of the field. Field names should consist of alphanumeric or underscore characters only<br />

and not start with a digit. This is not currently strictly enforced, but other field names will not have<br />

first class support from all components and back compatibility is not guaranteed. Names with both<br />

leading and trailing underscores (e.g. _ version_ ) are reserved. Every field must have a name.<br />

type The name of the fieldType for this field. This will be found in the " name" attribute on the field<br />

Type definition. Every field must have a type.<br />

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

67

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

Saved successfully!

Ooh no, something went wrong!