RediSearch / redisearch-getting-started

A RediSearch tutorial to learn the basis of RediSearch module, with sample application in Java, Python and Node.js
https://redisearch.io
145 stars 36 forks source link

Computed Search #115

Open imansafari1991 opened 1 year ago

imansafari1991 commented 1 year ago

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

xujunhai commented 10 months ago

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