Reuse script_fields value across query (in filters and aggregations)


I'm running a webshop and queries generated for customers include aggregations, filtering and sorting based on products prices. Some customers have special discounts on specific products (or group of products) and to calculate real product price I need to use scripts in the query.
I have some concerns regarding performance there but I guess there is no way around this. But what could help is if I could reuse the scripted field value (real price) across query so I don't have to recalculate it in filter, aggregation and sort query part...
Any suggestions?


(system) #2