Source:
<code>private IndexSearcher() { JsonArray typeFilters = new JsonArray(); String queriedEntityIdFieldName = null; Iterable<Class<?>> queriedEntityTypes = getQueriedEntityTypes(); for ( Class<?> queriedEntityType : queriedEntityTypes ) { entityTypesByName.put( queriedEntityType.getName(), queriedEntityType ); EntityIndexBinding binding = extendedIntegrator.getIndexBinding( queriedEntityType ); IndexManager[] indexManagers = binding.getIndexManagers(); for ( IndexManager indexManager : indexManagers ) { if ( !( indexManager instanceof ElasticsearchIndexManager ) ) { throw LOG.cannotRunEsQueryTargetingEntityIndexedWithNonEsIndexManager( queriedEntityType, jsonQuery.toString() ); } queriedEntityIdFieldName = binding.getDocumentBuilder().getIdentifierName(); ElasticsearchIndexManager esIndexManager = (ElasticsearchIndexManager) indexManager; indexNames.add( esIndexManager.getActualIndexName() ); } typeFilters.add( getEntityTypeFilter( queriedEntityType ) ); } this.idFieldName = queriedEntityIdFieldName; JsonObject filteredQuery = getFilteredQuery( jsonQuery.get( "query" ), typeFilters ); JsonBuilder.Object completeQuery = JsonBuilder.object(); <START> for ( Entry<String, JsonElement> entry : jsonQuery.entrySet() ) { <END> completeQuery.add( entry.getKey(), entry.getValue() ); } completeQuery.add( "query", filteredQuery ); if ( !getFacetManager().getFacetRequests().isEmpty() ) { JsonBuilder.Object facets = JsonBuilder.object(); for ( Entry<String, FacetingRequest> facetRequestEntry : getFacetManager().getFacetRequests().entrySet() ) { ToElasticsearch.addFacetingRequest( facets, facetRequestEntry.getValue() ); } completeQuery.add( "aggregations", facets ); } sortByDistanceIndex = getSortByDistanceIndex(); addScriptFields( completeQuery ); completeQueryAsString = completeQuery.build().toString(); }</code><technical_language>Do agree this is related fix hand? (just I understand correctly)</technical_language>

Target:
private IndexSearcher() { JsonArray typeFilters = new JsonArray(); String queriedEntityIdFieldName = null; Iterable<Class<?>> queriedEntityTypes = getQueriedEntityTypes(); for ( Class<?> queriedEntityType : queriedEntityTypes ) { entityTypesByName.put( queriedEntityType.getName(), queriedEntityType ); EntityIndexBinding binding = extendedIntegrator.getIndexBinding( queriedEntityType ); IndexManager[] indexManagers = binding.getIndexManagers(); for ( IndexManager indexManager : indexManagers ) { if ( !( indexManager instanceof ElasticsearchIndexManager ) ) { throw LOG.cannotRunEsQueryTargetingEntityIndexedWithNonEsIndexManager( queriedEntityType, jsonQuery.toString() ); } queriedEntityIdFieldName = binding.getDocumentBuilder().getIdentifierName(); ElasticsearchIndexManager esIndexManager = (ElasticsearchIndexManager) indexManager; indexNames.add( esIndexManager.getActualIndexName() ); } typeFilters.add( getEntityTypeFilter( queriedEntityType ) ); } this.idFieldName = queriedEntityIdFieldName; JsonObject filteredQuery = getFilteredQuery( jsonQuery.get( "query" ), typeFilters ); JsonBuilder.Object completeQuery = JsonBuilder.object(); completeQuery.add( "query", filteredQuery ); if ( !getFacetManager().getFacetRequests().isEmpty() ) { JsonBuilder.Object facets = JsonBuilder.object(); for ( Entry<String, FacetingRequest> facetRequestEntry : getFacetManager().getFacetRequests().entrySet() ) { ToElasticsearch.addFacetingRequest( facets, facetRequestEntry.getValue() ); } completeQuery.add( "aggregations", facets ); } sortByDistanceIndex = getSortByDistanceIndex(); addScriptFields( completeQuery ); completeQueryAsString = completeQuery.build().toString(); }