13.05.2014 Views

apache-solr-ref-guide-4.6.pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

sort on field true false true 1<br />

use field boosts 5 false<br />

document boosts affect searches within field false<br />

highlighting true 4 true 2 true 3<br />

faceting 5 true<br />

add multiple values, maintaining order true<br />

field length affects doc score false<br />

MoreLikeThis 5 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 recommended, but only required if<br />

stored=false.<br />

Defining Fields<br />

Once you have the field types set up, defining the fields themselves is simple. All you do is supply a name and a field type. If you wish, you can<br />

also provide options that will override the options for the field type.<br />

Fields are defined in the fields element of schema.xml. The following example defines a field named price with a type of sfloat.<br />

<br />

Fields can have the same options as field types. The field type options serve as defaults which can be overridden by options defined per field.<br />

Included below is the table of field type properties from the section Field Type Definitions and Properties:<br />

Property Description Values<br />

indexed If true, the value of the field can be used in queries to retrieve matching documents true or<br />

false<br />

stored If true, the actual value of the field can be retrieved by queries true or<br />

false<br />

docValues If true, the value of the field will be put in a column-oriented DocValues structure<br />

true or<br />

false<br />

sortMissingFirst<br />

sortMissingLast<br />

Control the placement of documents when a sort field is not present. As of Solr 3.5, these work for all<br />

numeric fields, including Trie and date fields.<br />

true or<br />

false<br />

multiValued If true, indicates that a single document might contain multiple values for this field type true or<br />

false<br />

omitNorms<br />

omitTermFreqAndPositions<br />

If true, omits the norms associated with this field (this disables length normalization and index-time<br />

boosting for the field, and saves some memory). Defaults to true for all primitive (non-analyzed) field<br />

types, such as int, float, data, bool, and string. Only full-text fields or fields that need an index-time boost<br />

need norms.<br />

If true, omits term frequency, positions, and payloads from postings for this field. This can be a<br />

performance boost for fields that don't require that information. It also reduces the storage space<br />

required for the index. Queries that rely on position that are issued on a field with this option will silently<br />

fail to find documents. This property defaults to true for all fields that are not text fields.<br />

true or<br />

false<br />

true or<br />

false<br />

omitPositions Similar to omitTermFreqAndPositions but preserves term frequency information<br />

true or<br />

false<br />

Apache Solr Reference Guide 4.6<br />

38

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

Saved successfully!

Ooh no, something went wrong!