O'Reilly logo

Mastering Apache Solr 7.x by Dharmesh Vasoya, Chintan Mehta, Sandeep Nair

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required