I don't like the idea of indexing a doc per each value, the dataset can grow
a lot. I have thought that something like this could work:
At indexing time, if I know the dates of no avaliability, I could gather the
avaliability ones (will consider unknown as available). So, I index 4 fields
aval_yes_start, aval_yes_end, aval_no_start, aval_no_end (all are
multiValued)
If the user ask for avaliability from $start to $end I filter like:

fq=aval_yes_start:[$start TO $end]&fq=aval_yes_end:[$start TO
$end]&fq=*-*aval_no_start:[$start TO $end]&fq=*-*aval_no_end:[$start TO
$end]

This way I make sure start date is available, end dates too and there are no
unavaliable gaps in between.
As I save ranges and no concrete days the number of multiValued shouldn't
grow a lot and using trie fields I think these range queries should be fast.

Any better idea?
 

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Search-calendar-avaliability-tp3457203p3457810.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to