lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Difference between currency fieldType and float fieldType
Date Tue, 06 Dec 2016 23:44:18 GMT
: Thanks for your reply.
: That means the best fieldType to use for money is currencyField, and not
: any other fieldType?

The primary use case for CurrencyField is when you want to do dynamic 
currency fluctuations between multiple currency types at query time -- but 
to do that you either need to use the FileExchangeRateProvider and have 
your owne backend system to update the exchange rates, or you have to have 
an account, or implement some other provider (with 
custom solr java code)

If you only care about a single type of currency -- for example, if all 
you care about is is US Dollars -- then just use either 
TrieIntField or TrieLongField and represent in the smallest possible 
increment you need to measure -- for US Dollars this would be cents. ie: 
$1234.56 would be put in your index as "123456"


View raw message