Skip to content

Commit

Permalink
fix geoip
Browse files Browse the repository at this point in the history
  • Loading branch information
original-brownbear committed Jan 2, 2024
1 parent d1affc4 commit 97071ce
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ private String mockSearches(String databaseName, int firstChunk, int lastChunk)
Map<String, ActionFuture<SearchResponse>> requestMap = new HashMap<>();
for (int i = firstChunk; i <= lastChunk; i++) {
byte[] chunk = data.get(i - firstChunk);
SearchHit hit = new SearchHit(i);
SearchHit hit = SearchHit.unpooled(i);
try (XContentBuilder builder = XContentBuilder.builder(XContentType.SMILE.xContent())) {
builder.map(Map.of("data", chunk));
builder.flush();
Expand All @@ -328,7 +328,7 @@ private String mockSearches(String databaseName, int firstChunk, int lastChunk)
throw new UncheckedIOException(ex);
}

SearchHits hits = new SearchHits(new SearchHit[] { hit }, new TotalHits(1, TotalHits.Relation.EQUAL_TO), 1f);
SearchHits hits = SearchHits.unpooled(new SearchHit[] { hit }, new TotalHits(1, TotalHits.Relation.EQUAL_TO), 1f);
SearchResponse searchResponse = new SearchResponse(hits, null, null, false, null, null, 0, null, 1, 1, 0, 1L, null, null);
toRelease.add(searchResponse::decRef);
@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 97071ce

Please sign in to comment.