Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change 
notification.

The "CurrencyField" page has been changed by HossMan:
http://wiki.apache.org/solr/CurrencyField?action=diff&rev1=10&rev2=11

Comment:
SOLR-4138 notes about ValueSource and currency(...) function

  price_c:10.00,NOK
  }}}
  
+ Begining with [[Solr4.2]] Currency values can also be used in functions.  By 
default, specifying a !CurrencyField in a function results in values 
corrisponding to the most granular precision of the defualt currency (eg: for 
USD, the most granular precision is cents), but there is also a 
{{{currency()}}} function that can be wrapped arround currency fields to 
generate values corrisponding to the natural value in either the default 
currency, or a user specified currency.
+ 
+ For example, assuming {{{price_c}}} is a !CurrencyField configured with the 
{{{defaultCurrency}}} of USD, and assume that with the current 
!ExchangeRateProvider {{{1.00,EUR == 2.00,USD}}}.  The table below shows what 
various functions would return for documents indexed with various currency 
values in this field
+ 
+ || Function || 6.54,USD || 10.00,USD  || 5.00,EUR ||
+ || price_c || 654 || 1000 || 1000 ||
+ || currency(price_c) || 6.54 || 10.0 || 10.0 ||
+ || currency(price_c,USD) || 6.54 || 10.0 || 10.0 ||
+ || currency(price_c,EUR) || 3.27 || 5.0 || 5.0 ||
+ 
  = Response Format =
  
  Solr documents will always yield the currency values they were indexed with, 
regardless of how they were queried for. For example, a set of documents 
indexed in USD will yield USD values for its Currency fields regardless if you 
performed queries in EUR. 

Reply via email to