mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-07-01 08:12:11 +00:00
DATAES-566 - Eliminate double SearchHit source to string conversion in DefaultResultMapper.
Original pull request: #275
This commit is contained in:
parent
e7857e874f
commit
4ab8af5116
@ -61,6 +61,7 @@ import com.fasterxml.jackson.core.JsonGenerator;
|
|||||||
* @author Ilkang Na
|
* @author Ilkang Na
|
||||||
* @author Sascha Woo
|
* @author Sascha Woo
|
||||||
* @author Christoph Strobl
|
* @author Christoph Strobl
|
||||||
|
* @author Dmitriy Yakovlev
|
||||||
*/
|
*/
|
||||||
public class DefaultResultMapper extends AbstractResultMapper {
|
public class DefaultResultMapper extends AbstractResultMapper {
|
||||||
|
|
||||||
@ -105,8 +106,9 @@ public class DefaultResultMapper extends AbstractResultMapper {
|
|||||||
for (SearchHit hit : response.getHits()) {
|
for (SearchHit hit : response.getHits()) {
|
||||||
if (hit != null) {
|
if (hit != null) {
|
||||||
T result = null;
|
T result = null;
|
||||||
if (!StringUtils.isEmpty(hit.getSourceAsString())) {
|
String hitSourceAsString = hit.getSourceAsString();
|
||||||
result = mapEntity(hit.getSourceAsString(), clazz);
|
if (!StringUtils.isEmpty(hitSourceAsString)) {
|
||||||
|
result = mapEntity(hitSourceAsString, clazz);
|
||||||
} else {
|
} else {
|
||||||
result = mapEntity(hit.getFields().values(), clazz);
|
result = mapEntity(hit.getFields().values(), clazz);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user