Mathias, I'd have to do a close review of the function sort code to be sure, but I suspect if you implement the equals() method on the ValueSource it should solve your caching issue. Also implement hashCode().
Joel On Thu, Oct 24, 2013 at 10:35 AM, Shawn Heisey <s...@elyograg.org> wrote: > On 10/24/2013 5:35 AM, Mathias Lux wrote: > > I've written a custom function, which is able to provide a distance > > based on some DocValues to re-sort result lists. This basically works > > great, but we've got the problem that if I don't change the query, but > > the function parameters, Solr delivers a cached result without > > re-ordering. I turned off caching and see there, problem solved. But > > of course this is not a avenue I want to pursue further as it doesn't > > make sense for a prodcutive system. > > > > Do you have any ideas (beyond fake query modification and turning off > > caching) to counteract? > > > > btw. I'm using Solr 4.4 (so if you are aware of the issue and it has > > been resolved in 4.5 I'll port it :) The code I'm using is at > > https://bitbucket.org/dermotte/liresolr > > I suspect that the queryResultCache is not paying attention to the fact > that parameters for your plugin have changed. This probably means that > your plugin must somehow inform the "cache check" code that something > HAS changed. > > How you actually do this is a mystery to me because it involves parts of > the code that are beyond my understanding, but it MIGHT involve making > sure that parameters related to your code are saved as part of the entry > that goes into the cache. > > Thanks, > Shawn > >