quarkiverse / quarkus-lucene

Quarkus Lucene Extension
Apache License 2.0
14 stars 5 forks source link

Questions because of a lack of documentation #144

Open wi21165 opened 1 year ago

wi21165 commented 1 year ago

Hello everyone,

I'm not sure if this is the right place for my questions so please correct me if there is a better place to aks them.

As the site https://quarkus.io/extensions/io.quarkiverse.lucene/quarkus-lucene suggests, there is an extension for Quarkus to make Lucene useable. Unfortunately, the documentation link just redirected me to this repository where besides the read me is no information on how to use the extension. I would be very glad if you could show me where to find, if it's existing, guides to use this extension.

And now i'll state my question here anyways for the case that the documentation doesn't exist at all.

My Situation: I'm trying to use Hibernate Search with a Lucene backend, for now in regular JVM-mode. Therefore i picked this Lucene dependency as well as the regular Hibernate Search ORM dependency (https://mvnrepository.com/artifact/org.hibernate/hibernate-search-orm). On Application start i get the exception which you can find on the bottom of this post. So is this problem because of the Extension which I'm trying to use (maybe because of Quarkus Maven plugin bootstrap sequence generation which doesn't work at this external library) or am I just using the wrong Extension or need to do Configurations or..?

As I said I'm sorry to bother you here but since I can't find any documentation this is my last resort :)

Thank you!

2023-07-11 11:49:25,270 INFO [org.hib.sea.eng.Version] (JPA Startup Thread) HSEARCH000034: Hibernate Search 5.11.12.Final 2023-07-11 11:49:26,550 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile [dev]): **org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.search.hcore.spi.EnvironmentSynchronizer]** at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:260) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:239) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:216) at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.getService(SessionFactoryServiceRegistryImpl.java:100) at org.hibernate.search.hcore.impl.HibernateSearchIntegrator.integrate(HibernateSearchIntegrator.java:61) at org.hibernate.integrator.spi.Integrator.integrate(Integrator.java:65) at org.hibernate.internal.SessionFactoryImpl.integrate(SessionFactoryImpl.java:466) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:246) at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.build(FastBootEntityManagerFactoryBuilder.java:84) at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:74) at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:80) at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) at io.quarkus.hibernate.orm.runtime.JPAConfig$LazyPersistenceUnit.get(JPAConfig.java:156) at io.quarkus.hibernate.orm.runtime.JPAConfig$1.run(JPAConfig.java:64) at java.base/java.lang.Thread.run(Thread.java:834)

dainiusjocas commented 1 year ago

Hi, I'm not too familiar with Hibernate Search. However, to my understanding you only need this library if you plan to compile the app with the native-image. You said that you're running in the JVM mode, maybe try to use regular Lucene dependencies and check if it works?

gsmet commented 1 year ago

For now, only Hibernate Search with Elasticsearch is supported with Quarkus. And indeed your issue is really related to Hibernate Search and not the Lucene extension

/cc @yrodiere who is the Hibernate Search lead and might be interested to hear that people are trying to do use it with Lucene in a Quarkus environment.

yrodiere commented 1 year ago

Indeed if you need to use Hibernate Search in Quarkus you need an extension, so that it integrates correctly with the Hibernate ORM extension for Quarkus.

At the moment the Hibernate Search extension in Quarkus only targets Elasticsearch. I encourage you to try it if setting up an Elasticsearch cluster is acceptable to you: it's very mature and should be able to do everything you used to do with Hibernate Search + Lucene, with the additional benefit of being able to take advantage of Elasticsearch's clustering and features.

I created an issue in quarkus-hibernate-search-extras to create a new extension for Hibernate ORM + Hibernate Search + Lucene: https://github.com/quarkiverse/quarkus-hibernate-search-extras/issues/179