简体   繁体   中英

Lucene : Best way to store and query a datastructure

I have a product whose price vary with day of week and season (like hotel room). So consider, i have a rate card (and I can attach multiple rate cards to a product)

RateCard fields are

DateTime startdate
DateTime enddate
int priority
double price
double mon_surcharge
double tue_surcharge
double wed_surcharge
double thur_surcharge
double fri_surcharge
double sat_surcharge
double sun_surcharge

So my question is - how can i find product with order: start and end date, with range of min-max prices and sort them by price Any suggestions

In Lucen.NET I'd recommend that you change the structure of the price data to mon_price, tue_price, etc rather then having daily surcharges that must be added to price.

If you go with a daily price field then doing a range search on that field (or fields) should work great.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM