I have a form where i enter min price and max price when creating product details. In the product search i have also 2 fields called min and max. So how can i get the result of given range considering the range given when inserting products
Products
min max
10 15
15 30
20 30
In the search form i insert min as 5 and max as 16. Which products i will get in the result and whats the best theory for searching considering practical situations.
Compare opposite ends of each range to find products in the overlap:
This approach works well for date ranges too.