I'm using Solr as part of a property booking engine- my entries have a multivalued date field which stores the dates that the property is already booked, and thus, not available. I want to be able to query against this, and return entries that have no dates within the window specified.
I'm half way there- but right now Solr appears to be returning the entry if it has even one free date- I want it to only return entries that are totally empty within the range. Example of my entity:
<doc>
<arr name="DateBlockDates">
<date>2011-02-25T00:00:00Z</date>
<date>2011-02-26T00:00:00Z</date>
<date>2011-02-27T00:00:00Z</date>
</arr>
</doc>
The query works great in this instance:
-DateBlockDates:[2011-02-25T00:00:00Z TO 2011-02-27T00:00:00Z]
Because the entity does have date blocks for every one of those days. However, when I run:
-DateBlockDates:[2011-02-25T00:00:00Z TO 2011-02-28T00:00:00Z]
The entity gets returned, because it doesn't have an entry for 2011-02-28.
To put my question into old-school SQL, I want to do a "count(DateBlockDates) = 0". Any ideas?