On Tue, Aug 25, 2015, at 10:54 PM, Yonik Seeley wrote: > On Tue, Aug 25, 2015 at 5:02 PM, O. Klein <kl...@octoweb.nl> wrote: > > I'm trying to find the best way to search for stores that are open NOW. > > It's probably not the *best* way, but assuming it's currently 4:10pm, > you could do > > +open:[* TO 1610] +close:[1610 TO *] > > And to account for days of the week have different fields for each day > openM, closeM, openT, closeT, etc... not super elegant, but seems to > get the job done.
So, the basic question is what does "now" mean? If it is 5:29pm and a shop closes at 5:30pm, does that count as "open"? If you want to query "a single time" within a range, then Yonik's approach will work (although I'd use open0 to open6 for the days of the week). If you want to find a range within another range, then use what Alexandre suggested - spatial search functionality. For example, you could say, is the shop open for 10 minutes either side of "now". Of course, you could use spatial for a time within a range, and it might be a little more elegant because you can use a multivalued field to specify the open/close ranges for your store. Upayavira