: > Why don't we just include the start & rows (modulo the window size) in
: > the cache key?
: 
: The implementation of equals() would be rather difficult... actually
: impossible w/o abusing the semantics.
: It would also be impossible w/o the Map implementation guaranteeing
: what object was on the LHS vs the RHS when equals was called.
: 
: Unless I'm missing something obvious?

You've totally confused me.

What i'm saying is that SolrIndexSearcher should consult the window size 
before consulting the cache -- the start param should be rounded down to 
the nearest multiple of hte window size, and start+rows (ie: end) should 
be rounded up to one less then the nearest multiple of the windows size, 
and then that should be looked up in the cache.

equality on the cache key is straight forward...
   this.q==that.q && this.start==that.start && this.end==that.end && 
   this.sort == that.sort && this.filters == that.filters

so if the window size is "50" and SOlrIndexSearcher gets a request like 
q=x&start=33&rows=10&sort=y&fq=... it should  
generate a cache key where start=0 and end=49.  (if start=33&rows=42, then 
the key would contain start=0 and end=99 ... which could result in some 
overlap, but that's why people are suppose to pick a window size greater 
then the largest number of rows typically requested)



-Hoss

Reply via email to