diff --git a/src/main/java/io/quarkus/search/app/entity/Guide.java b/src/main/java/io/quarkus/search/app/entity/Guide.java index c440bcd3..9fd34ef8 100644 --- a/src/main/java/io/quarkus/search/app/entity/Guide.java +++ b/src/main/java/io/quarkus/search/app/entity/Guide.java @@ -6,6 +6,7 @@ import java.util.Set; import io.quarkus.search.app.hibernate.AnalysisConfigurer; +import io.quarkus.search.app.hibernate.GuideLoadingBinder; import io.quarkus.search.app.hibernate.I18nFullTextField; import io.quarkus.search.app.hibernate.I18nKeywordField; import io.quarkus.search.app.hibernate.InputProvider; @@ -27,7 +28,7 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.SearchEntity; -@SearchEntity(loadingBinder = @EntityLoadingBinderRef(name = "guideLoadingBinder")) +@SearchEntity(loadingBinder = @EntityLoadingBinderRef(type = GuideLoadingBinder.class)) @Indexed(routingBinder = @RoutingBinderRef(type = QuarkusVersionAndLanguageRoutingBinder.class)) public class Guide { @DocumentId diff --git a/src/main/java/io/quarkus/search/app/hibernate/GuideLoadingBinder.java b/src/main/java/io/quarkus/search/app/hibernate/GuideLoadingBinder.java index 361df1f6..dae617c3 100644 --- a/src/main/java/io/quarkus/search/app/hibernate/GuideLoadingBinder.java +++ b/src/main/java/io/quarkus/search/app/hibernate/GuideLoadingBinder.java @@ -2,9 +2,6 @@ import java.util.List; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Named; - import io.quarkus.search.app.entity.Guide; import org.hibernate.search.mapper.pojo.standalone.loading.LoadingTypeGroup; @@ -17,8 +14,6 @@ import org.hibernate.search.mapper.pojo.standalone.loading.binding.EntityLoadingBinder; import org.hibernate.search.mapper.pojo.standalone.loading.binding.EntityLoadingBindingContext; -@ApplicationScoped -@Named("guideLoadingBinder") public class GuideLoadingBinder implements EntityLoadingBinder { @Override diff --git a/src/main/java/io/quarkus/search/app/hibernate/QuarkusIOLoadingContext.java b/src/main/java/io/quarkus/search/app/hibernate/QuarkusIOLoadingContext.java index c73533b3..29ba5e5b 100644 --- a/src/main/java/io/quarkus/search/app/hibernate/QuarkusIOLoadingContext.java +++ b/src/main/java/io/quarkus/search/app/hibernate/QuarkusIOLoadingContext.java @@ -26,7 +26,7 @@ public int size() { return -1; } - public synchronized List nextBatch(int batchSize) { + public List nextBatch(int batchSize) { List list = new ArrayList<>(); for (int i = 0; guides.hasNext() && i < batchSize; i++) { list.add(guides.next());