In my Lucene.Net index, I have documents with a startDate field and an endDate field. Both fields store dates in yyyyMMdd format. How can I build a query that will return hits if today's date falls between those two dates?
startDateFieldValue < myTargetDate < endDateFieldValue
For example, if myTargetDate is 17760604, I'd want to get a document back that had a startDate field value of 10660101 and an endDate field value of 19990101.
The scenario is that I have a Lucene database with Lucene documents that represent particular building sites. Each site has a StartConstruction date and an EndConstruction date. My users will enter a specific date, and I want to find all properties that were currently under construction on that date.
Note: I'm working with Lucene.Net 1.9, a much older version, and my company can't upgrade (yet).
+mydatefield:[10660101 TO 19990101] +myotherfield:dthrasher
– L.B