简体   繁体   English

Solr与计算的价格字段

[英]Solr with calculated Price field

I am having a Solr used for my eCommerce search. 我正在将Solr用于我的电子商务搜索。 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. 但是,我不确定如何在Solr中使用另一种货币并对同一货币进行构面范围查询。 This another currency is actually calculated using a live exchange rate. 这另一种货币实际上是使用实时汇率计算的。 I am not sure how to implement the same into Solr. 我不确定如何在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. 因此,如果仅显示另一种货币的价格,我就可以轻松地在View端处理,但是如何将Solr中的所有这些构面和排序应用到另一种货币的此计算价格上。

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的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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