diff --git a/elx-api/src/main/java/org/xbib/elx/api/SearchResult.java b/elx-api/src/main/java/org/xbib/elx/api/SearchResult.java index e240d50..02fc704 100644 --- a/elx-api/src/main/java/org/xbib/elx/api/SearchResult.java +++ b/elx-api/src/main/java/org/xbib/elx/api/SearchResult.java @@ -13,4 +13,6 @@ public interface SearchResult { List getDocuments(); Aggregations getAggregations(); + + boolean isTimedOut(); } diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java index ee9086e..7e62e15 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java @@ -167,7 +167,8 @@ public abstract class AbstractSearchClient extends AbstractBasicClient implement Optional.empty() : Optional.of(new DefaultSearchResult(searchResponse.getHits(), searchResponse.getAggregations(), - searchResponse.getTook().getMillis())); + searchResponse.getTook().getMillis(), + searchResponse.isTimedOut())); } @Override @@ -253,7 +254,8 @@ public abstract class AbstractSearchClient extends AbstractBasicClient implement .flatMap(searchResponse -> new DefaultSearchResult(searchResponse.getHits(), searchResponse.getAggregations(), - searchResponse.getTook().getMillis()).getDocuments().stream()); + searchResponse.getTook().getMillis(), + searchResponse.isTimedOut()).getDocuments().stream()); } @Override diff --git a/elx-common/src/main/java/org/xbib/elx/common/DefaultSearchResult.java b/elx-common/src/main/java/org/xbib/elx/common/DefaultSearchResult.java index 44d808e..ac272e9 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/DefaultSearchResult.java +++ b/elx-common/src/main/java/org/xbib/elx/common/DefaultSearchResult.java @@ -17,12 +17,16 @@ public class DefaultSearchResult implements SearchResult { private final long took; + private final boolean timedout; + public DefaultSearchResult(SearchHits searchHits, Aggregations aggregations, - long took) { + long took, + boolean timedout) { this.searchHits = searchHits; this.aggregations = aggregations; this.took = took; + this.timedout = timedout; } @Override @@ -48,4 +52,8 @@ public class DefaultSearchResult implements SearchResult { return took; } + @Override + public boolean isTimedOut() { + return timedout; + } } diff --git a/gradle.properties b/gradle.properties index bdd799a..ba910de 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ group = org.xbib name = elx -version = 7.10.2.15 +version = 7.10.2.16 gradle.wrapper.version = 6.6.1 xbib-metrics.version = 2.2.0 @@ -9,7 +9,7 @@ elasticsearch.version = 7.10.2 # ES 7.10.2 uses Jackson 2.10.4 jackson.version = 2.12.3 # ES 7.10.2. uses Netty 4.1.49 -xbib-netty-http.version = 4.1.65.0 +xbib-netty-http.version = 4.1.66.0 # ES 7.10.2 uses log4j2 2.11.1 log4j.version = 2.14.1 junit.version = 5.7.1