I developed a post filter. My documents to be filtered are on two different shards. So, in a single-shard environment, DelegatingCollector.doSetNextReader is called twice. And collect is called the correct number of times. Everything went well and I got my correct number of results back.
So, I then tried this filter in a two-shard environment. This time things did not work well. I am still trying to figure out what is going on, but it seems like just the first shard is being used. I get the same results no matter what shard or replica I begin my query on. But it seems like the results are not being merged. Although I am still trying to figure out if the second shard is even being queried. Are there any known issues with DelegatingCollector and shards? I don't know if this is related, but I did once get the following error message as well. java.lang.UnsupportedOperationException: Query {!cache=false cost=100} does not implement createWeight