Currency Field / Currency function

Hi All,

I'm new to ES but in Solr I've implemented a custom ValueSourceParser that can read an exchange rate file, and using currency and currency_amount fields, I can for example incorporate a USD value into the scoring.

I was thinking of writing a custom function score query, so then able to query something like:

GET /_search
{
"query": {
"function_score": {
"query": { "match_all": {} }, #or whatever....
"currency_function": {
"currency_field": "currency",
"amount_field" : "currency_amount",
"default_currency" : "USD",
"exchange_file" : "http://..."
}
}
}
}

Has this been done before and is this the best approach?

In ES How can I read the exchange file and if stored locally i.e. file://.... where can I store and how might I be able to read it.

Cheers,
Dan