allow access to UTF-8 content in SearchDocument
This commit is contained in:
parent
88c550d9c1
commit
8df4681894
5 changed files with 18 additions and 1 deletions
|
@ -10,5 +10,7 @@ public interface SearchDocument {
|
|||
|
||||
float getScore();
|
||||
|
||||
String getContent();
|
||||
|
||||
Map<String, Object> getFields();
|
||||
}
|
||||
|
|
|
@ -28,6 +28,11 @@ public class DefaultSearchDocument implements SearchDocument {
|
|||
return searchHit.getScore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContent() {
|
||||
return searchHit.getSourceRef().utf8ToString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getFields() {
|
||||
return searchHit.getSourceAsMap();
|
||||
|
|
|
@ -27,6 +27,11 @@ public class GetDocument implements SearchDocument {
|
|||
return -1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContent() {
|
||||
return getResponse.getSourceAsBytesRef().utf8ToString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getFields() {
|
||||
return getResponse.getSourceAsMap();
|
||||
|
|
|
@ -27,6 +27,11 @@ public class MultiGetDocument implements SearchDocument {
|
|||
return -1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContent() {
|
||||
return getResponse.getResponse().getSourceAsBytesRef().utf8ToString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getFields() {
|
||||
return getResponse.getResponse().getSourceAsMap();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
group = org.xbib
|
||||
name = elx
|
||||
version = 7.10.2.23
|
||||
version = 7.10.2.24
|
||||
|
||||
org.gradle.warning.mode = ALL
|
||||
|
|
Loading…
Reference in a new issue