title: Spring Data Elasticsearch working fine for saving data but returns empty array with findAll
body: <p>I have made an application using Springboot and running Elasticsearch in the background, everything works fine and when I am saving data by passing some json data it returns the right result(the number of inserted data) but when I am trying to fetch the datas it is returning empty array symbols.</p>
  
  <p>Not getting what's happening can anybody please help.</p>
  
  <p>And I have attached the screenshots of my postman requests.</p>
  
  <p>For Saving data
  <img src="https://i.stack.imgur.com/Xnhio.png" alt="For Saving data"></p>
  
  <p>For Fetching data
  <img src="https://i.stack.imgur.com/1nfmG.png" alt="For Fetching data"></p>
  
  <p>My api class:-</p>
  
  <pre><code>@SpringBootApplication
  @RestController
  public class SpringBootElasticserachExampleApplication {
  
  @Autowired
  private HeroRepository repository;
  
  @PostMapping("/saveHero")
  public int saveCustomer(@RequestBody List&lt;Hero&gt; heros) {        
  
      repository.saveAll(heros);
      return heros.size();
  }
  
  @GetMapping("/findAll")
  public Iterable&lt;Hero&gt; findAllHeros() {
  
      return repository.findAll();
  }
  }
  </code></pre>
  
  <p>Model class:</p>
  
  <pre><code>@Document(indexName="movie",type="hero",shards=2)
  @Data
  @AllArgsConstructor
  @NoArgsConstructor
  public class Hero {
  
  @Id
  private String id;
  private String firstname;
  private String lastname;
  private int age;
  
  }
  </code></pre>
  
  <p>Repository:</p>
  
  <pre><code>public interface HeroRepository extends ElasticsearchRepository&lt;Hero, String&gt;{
  
  List&lt;Hero&gt; findByFirstname(String firstName);
  
  }
  </code></pre>