Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ElasticSearch client library to 7.10+ #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# curl http://localhost:8100/yacy/grid/mcp/info/status.json

## build app
FROM eclipse-temurin:8-jdk-alpine AS appbuilder
FROM eclipse-temurin:11-jdk-alpine AS appbuilder
COPY ./ /app
WORKDIR /app
RUN ./gradlew clean shadowDistTar

## build dist
FROM eclipse-temurin:8-jre-alpine
FROM eclipse-temurin:11-jre-alpine
LABEL maintainer="Michael Peter Christen <[email protected]>"
ENV DEBIAN_FRONTEND noninteractive
ARG default_branch=master
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile_arm32
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# curl http://localhost:8100/yacy/grid/mcp/info/status.json

## build app
FROM arm32v7/eclipse-temurin:8-jdk AS appbuilder
FROM arm32v7/eclipse-temurin:11-jdk AS appbuilder
COPY ./ /app
WORKDIR /app
RUN ./gradlew assemble

## build dist
FROM arm32v7/eclipse-temurin:8-jre
FROM arm32v7/eclipse-temurin:11-jre
LABEL maintainer="Michael Peter Christen <[email protected]>"
ENV DEBIAN_FRONTEND noninteractive
ARG default_branch=master
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile_arm64
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# curl http://localhost:8100/yacy/grid/mcp/info/status.json

## build app
FROM arm64v8/eclipse-temurin:8-jdk AS appbuilder
FROM arm64v8/eclipse-temurin:11-jdk AS appbuilder
COPY ./ /app
WORKDIR /app
RUN ./gradlew assemble

## build dist
FROM arm64v8/eclipse-temurin:8-jre
FROM arm64v8/eclipse-temurin:11-jre
LABEL maintainer="Michael Peter Christen <[email protected]>"
ENV DEBIAN_FRONTEND noninteractive
ARG default_branch=master
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dependencies {
implementation 'org.eclipse.jetty:jetty-server:9.4.+'
implementation 'org.eclipse.jetty:jetty-servlet:9.4.+'
implementation 'org.eclipse.jgit:org.eclipse.jgit:5.+'
implementation 'org.elasticsearch.client:transport:6.8.+'
implementation 'org.elasticsearch.client:transport:7.10.+'
implementation 'org.mapdb:mapdb:3.+'
implementation 'org.slf4j:log4j-over-slf4j:1.7.+'
implementation 'org.slf4j:slf4j-jdk14:1.7.+'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ private QueryBuilder getQuery(QueryLanguage language, String query) {
}
} else if (language == QueryLanguage.elastic) {
QueryStringQueryBuilder qsqb = QueryBuilders.queryStringQuery(query);
qsqb.useDisMax(false); // we want a boolean query here
qsqb.defaultOperator(Operator.AND);
qsqb.fuzziness(Fuzziness.ZERO);
qb = qsqb;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/yacy/grid/io/index/ElasticsearchClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public long count(final QueryBuilder q, final String indexName) {

public long countInternal(final QueryBuilder q, final String indexName) {
SearchResponse response = this.elasticsearchClient.prepareSearch(indexName).setQuery(q).setSize(0).execute().actionGet();
return response.getHits().getTotalHits();
return response.getHits().getTotalHits().value;
}

/**
Expand Down Expand Up @@ -754,7 +754,7 @@ private Query(final String indexName, final QueryBuilder queryBuilder, final Que
// get response
SearchResponse response = request.execute().actionGet();
SearchHits searchHits = response.getHits();
this.hitCount = (int) searchHits.getTotalHits();
this.hitCount = (int) searchHits.getTotalHits().value;

// evaluate search result
//long totalHitCount = response.getHits().getTotalHits();
Expand Down