Have you looked at the expressions module? It provides support for user-defined computation using values from the index based on a simple expression language. It might prove useful to you if the exchange rate needs to be tracked very dynamically.
On Thu, Sep 2, 2021 at 2:15 PM Kumaran Ramasubramanian <kums....@gmail.com> wrote: > > I am having one use case regarding currency based search. I want to get any > suggestions or pointers.. > > For example, > Assume, > 1USD = 75 INR > 1USD = 42190 IRR > similarly, we have support for 100 currencies as of now. > > Record1 created with PRICE 150 INR & EXCHANGE_RATE 75 for USD > Record2 created with PRICE 84380 IRR & EXCHANGE_RATE 42190 for USD > > If i search 2 ( USD ), I would like to get both Record1 & Record2 as search > results > > PRICE & EXCHANGE_RATE are indexed & stored as separate fields in the search > index > We can have 50 number of currency fields like PRICE. so we may need to > index additional 50 fields holding USD values. > > To avoid additional fields, Is it possible to match records in the search > index by applying an expression like (PRICE / EXCHANGE_RATE ) > > I am not sure if this is the right use case for Lucene index. But I would > like to know the possibilities. Thanks in advance > > > -- > Kumaran R > Chennai, India --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org