Understanding currencies and exchange rates 

As the name implies, a currency field type is used for any monetary value. It supports currency conversion and exchange rates during a query.

Solr provides the following features for it:

  • Range queries
  • Point queries
  • Sorting
  • Function range queries
  • Symmetric and asymmetric exchange rates
  • Currency parsing

As with other field types, the currency field type is configured in schema.xml. Shown here is the default configuration:

<fieldType name="currency" class="solr.CurrencyFieldType"                           amountLongSuffix="_l_ns" codeStrSuffix="_s_ns"         defaultCurrency="USD" currencyConfig="currency.xml" />

As you can see, name is set as currency and class is specified as solr.CurrencyFieldType. We have defined the defaultCurrency ...

Get Mastering Apache Solr 7.x now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.