diff --git a/elx-api/src/main/java/org/xbib/elx/api/SearchDocument.java b/elx-api/src/main/java/org/xbib/elx/api/SearchDocument.java index 6bbf691..cc06013 100644 --- a/elx-api/src/main/java/org/xbib/elx/api/SearchDocument.java +++ b/elx-api/src/main/java/org/xbib/elx/api/SearchDocument.java @@ -10,5 +10,7 @@ public interface SearchDocument { float getScore(); + String getContent(); + Map getFields(); } diff --git a/elx-common/src/main/java/org/xbib/elx/common/DefaultSearchDocument.java b/elx-common/src/main/java/org/xbib/elx/common/DefaultSearchDocument.java index 7185201..f14d88d 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/DefaultSearchDocument.java +++ b/elx-common/src/main/java/org/xbib/elx/common/DefaultSearchDocument.java @@ -28,6 +28,11 @@ public class DefaultSearchDocument implements SearchDocument { return searchHit.getScore(); } + @Override + public String getContent() { + return searchHit.getSourceRef().utf8ToString(); + } + @Override public Map getFields() { return searchHit.getSourceAsMap(); diff --git a/elx-common/src/main/java/org/xbib/elx/common/GetDocument.java b/elx-common/src/main/java/org/xbib/elx/common/GetDocument.java index 4d47d6b..a3547b0 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/GetDocument.java +++ b/elx-common/src/main/java/org/xbib/elx/common/GetDocument.java @@ -27,6 +27,11 @@ public class GetDocument implements SearchDocument { return -1f; } + @Override + public String getContent() { + return getResponse.getSourceAsBytesRef().utf8ToString(); + } + @Override public Map getFields() { return getResponse.getSourceAsMap(); diff --git a/elx-common/src/main/java/org/xbib/elx/common/MultiGetDocument.java b/elx-common/src/main/java/org/xbib/elx/common/MultiGetDocument.java index 346fabc..280e9f7 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/MultiGetDocument.java +++ b/elx-common/src/main/java/org/xbib/elx/common/MultiGetDocument.java @@ -27,6 +27,11 @@ public class MultiGetDocument implements SearchDocument { return -1f; } + @Override + public String getContent() { + return getResponse.getResponse().getSourceAsBytesRef().utf8ToString(); + } + @Override public Map getFields() { return getResponse.getResponse().getSourceAsMap(); diff --git a/gradle.properties b/gradle.properties index ecc8367..2caa0ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group = org.xbib name = elx -version = 7.10.2.23 +version = 7.10.2.24 org.gradle.warning.mode = ALL