private Map < String , Object > buildResultMap ( SearchResponse response , KunderaQuery query , EntityMetadata m , MetamodelImpl metaModel ) { Map < String , Object > map = new LinkedHashMap <> ( ) ; ESResponseWrapper esResponseReader = new ESResponseWrapper ( ) ; for ( SearchHit hit : response . getHits ( ) ) { Object id = PropertyAccessorHelper . fromSourceToTargetClass ( ( ( AbstractAttribute ) m . getIdAttribute ( ) ) . getBindableJavaType ( ) , String . class , hit . getId ( ) ) ; map . put ( hit . getId ( ) , id ) ; } Map < String , Object > aggMap = esResponseReader . parseAggregations ( response , query , metaModel , m . getEntityClazz ( ) , m ) ; ListIterable < Expression > selectExpressionOrder = esResponseReader . getSelectExpressionOrder ( query ) ; Map < String , Object > resultMap = new HashMap <> ( ) ; resultMap . put ( Constants . AGGREGATIONS , aggMap ) ; resultMap . put ( Constants . PRIMARY_KEYS , map ) ; resultMap . put ( Constants . SELECT_EXPRESSION_ORDER , selectExpressionOrder ) ; return resultMap ; }
Builds the result map .