AnsweredAssumed Answered

Find files by comparing date properties?

Question asked by lyamamot on Apr 1, 2009
I have a type that has two date properties, start and end. I want to find all files of that type where an arbitrary date (for example, today) is between start and end. One use case for this is to find whether a file is "active" given a target date and two properties, "activeStart" and "activeEnd." The two ways I've thought of to do this are:
  • Query for all files of that type and manually calculate whether the date is between the two properties. This works, but I'm afraid of the performance implications if I get many files that I have to reject because they don't meet the criteria.

  • Issue a date range query with arbitrarily early and arbitrarily future dates, such as '+TYPE:"ex:mytype" +@ex\\:activeStart:[01-01-1970T00:00:00 TO 03-31-2009T00:00:00] +@ex\\:activeEnd:[03-31-2009T00:00:00 TO 12-31-2100T00:00:00]'. Having to pick such arbitrary dates seems like a poor hack to me.