title: Spring Boot & Elastic Search | Multi-index search functionality
body: <p>I have a spring boot API which has three models (User, Projects, Skills) currently I can search any of the indexes without issue as below:</p>
  <pre><code>  log.info(&quot;Search with query {}&quot;, query);
          Pageable pageable = PageRequest.of(page, size);
  
          QueryBuilder queryBuilder =
                  QueryBuilders
                          .multiMatchQuery(query, &quot;projectDescription&quot;, &quot;projectName&quot;, &quot;projectTechStack&quot;)
                          .fuzziness(Fuzziness.ONE);
  
          Query searchQuery = new NativeSearchQueryBuilder()
                  .withFilter(queryBuilder)
                  .withPageable(pageable)
                  .build();
  
          SearchHits&lt;UserProjects&gt; projectHits =
                  elasticsearchOperations
                          .search(searchQuery, UserProjects.class,
                                  IndexCoordinates.of(elasticProjectsIndex));
  </code></pre>
  <p>However I would like to search all three indices and map them to the correct POJO. I'm rather stuck on this. Furthermore and this is where I get VERY stuck is, I would like to have a response paginated which would contain lets say the following:</p>
  <pre><code>User results: 3 of 100 
  Project Results 4 of 10
  etc etc
  </code></pre>
  <p>Basically so on my front end I can know if I should show a &quot;click here for more User results&quot; link which would run a search just on the user index.</p>
  <p>If anyone can please help me that would be amazing.</p>
  <p>Thanks</p>