redisearch-getting-started icon indicating copy to clipboard operation
redisearch-getting-started copied to clipboard

Computed Search

Open imansafari1991 opened this issue 2 years ago • 1 comments

Hi there, Consider I have a schema for my products as follows: [{ "Name":"p1", "Price":10000, "Discount":0.5 }, { "Name":"p2", "Price":20000, "Discount":0.3 }]

I want to find products whose price after discount is less than 7000. like the following predicate: p=>p.Price*(1-p.Discount)<7000

How can I write this query in redissearch?

Thanks

imansafari1991 avatar Feb 03 '23 16:02 imansafari1991

you can add a field , call DiscountPrice then you can do search.

xujunhai avatar Nov 01 '23 03:11 xujunhai