It appears that I can only get query results from the cache if the key in the cache is a String.
I looked at the code in LazyIterator (I didn't check EagerIterator since it fails so I'm assuming the code is similar) and there is a line that retrieves the documentId from the extractor and casts it as a String.
The cast works but the documentId (the key) is entered in the cache as an Integer so the lookup fails. The result count is correct so I know it finds the results correctly but the lookup fails so I get a null in the iterator.
Bryan
Yes, this was a limitation of the current release - that keys had to be Strings. This limitation will go away with the next CR release.