Fix a cast exception when query a map only index and using the Result instead of the entity object itself.