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.

TrieField<br />

TrieFloatField<br />

TrieIntField<br />

TrieLongField<br />

UUIDField<br />

If this field type is used, a "type" attribute must also be specified, valid<br />

values are: integer, long, float, double, date. Using this field is<br />

the same as using any of the Trie fields. precisionStep="0" enabl<br />

es efficient numeric sorting and minimizes index size; precisionSte<br />

p="8" (the default) enables efficient range queries.<br />

Floating point field (32-bit IEEE floating point). precisionStep="0"<br />

enables efficient numeric sorting and minimizes index size; precisio<br />

nStep="8" (the default) enables efficient range queries.<br />

Integer field (32-bit signed integer). precisionStep="0" enables<br />

efficient numeric sorting and minimizes index size; precisionStep=<br />

"8" (the default) enables efficient range queries.<br />

Long field (64-bit signed integer). precisionStep="0" enables<br />

efficient numeric sorting and minimizes index size; precisionStep=<br />

"8" (the default) enables efficient range queries.<br />

Universally Unique Identifier (UUID). Pass in a value of "NEW" and<br />

<strong>Solr</strong> will create a new UUID. Note: configuring a UUIDField instance<br />

with a default value of "NEW" is not advisable for most users when<br />

using <strong>Solr</strong>Cloud (and not possible if the UUID value is configured as<br />

the unique key field) since the result will be that each replica of each<br />

document will get a unique UUID value. Using<br />

UUIDUpdateProcessorFactory to generate UUID values when<br />

documents are added is recommended instead.<br />

Working with Currencies and Exchange Rates<br />

The currency FieldType provides support for monetary values to <strong>Solr</strong>/Lucene with query-time currency<br />

conversion and exchange rates. The following features are supported:<br />

Point queries<br />

Range queries<br />

Function range queries<br />

Sorting<br />

Currency parsing by either currency code or symbol<br />

Symmetric & asymmetric exchange rates (asymmetric exchange rates are useful if there are fees<br />

associated with exchanging the currency)<br />

Configuring Currencies<br />

The currency field type is defined in schema.xml. This is the default configuration of this type:<br />

<br />

In this example, we have defined the name and class of the field type, and defined the defaultCurrency as<br />

"USD", for U.S. Dollars. We have also defined a currencyConfig to use a file called "currency.xml". This is a<br />

file of exchange rates between our default currency to other currencies. There is an alternate implementation that<br />

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

55

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

Saved successfully!

Ooh no, something went wrong!