简体   繁体   中英

Solr with calculated Price field

I am having a Solr used for my eCommerce search. With single currency it works great. However, I am not sure how to have another currency to Solr and do a facet range queries on the same. This another currency is actually calculated using a live exchange rate. I am not sure how to implement the same into Solr.

I have facets on Price as well as Price Range filter on search page. Moreover, Price is used for sorting.

So if its just about displaying Price in another currency I can handle easily on View side, but how to have all these faceting & sorting from Solr to be applied on this Calculated Price in another currency.

One idea is to have calculated filed using mathematical function, but I'm not sure if that supports faceting, sorting, etc. Moreover, currency is dynamic and changes frequently so we also need to update math function frequently.

Any idea on the same will be appreciable.

Thanks in Advance

如果货币汇率是动态的,则可以使用一个函数,但最简单的方法是将仅本金存储在solr中,然后在查询solr之前将其转换为您的应用程序,然后再次查询solr的结果。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM