quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

Hibernate Search Standalone Pojo Mapper: Hibernate Search without Hibernate ORM / datasource

Open cthiebault opened this issue 3 years ago • 6 comments

Description

It would be great to be able to use Hibernate Search without a datasource but just to index data to Elasticsearch.

I'm persisting my entities to DynamoDB and I need to index them to Elasticsearch/Opensearch.
Right now I can't use Hibernate Search because it requires a datasource to persist entities before indexing them.

I could use an in-memory datasource like H2 and forget about it on shutdown (we are using AWS Lambda) but as we use Quarkus to improve our memory footprint it's really not the best approach :-/

Implementation ideas

No response

cthiebault avatar Jun 16 '22 13:06 cthiebault

/cc @gsmet, @yrodiere

quarkus-bot[bot] avatar Jun 16 '22 13:06 quarkus-bot[bot]

I'm glad you asked :) This is being worked on upstream, when that's ready we'll have a look at adding it to Quarkus.

yrodiere avatar Jun 16 '22 13:06 yrodiere

To clarify, and to make @gsmet happy: when I say it's being worked on, it's actually the main focus of the very next version of Hibernate Search (6.2). So, it's being actively worked on :)

yrodiere avatar Jun 16 '22 13:06 yrodiere

@yrodiere just saw it has been released upstream and I rebase an old prototype I made years ago (to base an hypotetical Elasticsearch with Panache extension on it, see https://groups.google.com/g/quarkus-dev/c/pDQJ_yRNML4/m/UjCwseXXAwAJ).

So I have a working protocole for Hibernate Search Pojo Standalone Elasticsearch which I can propose when 6.2.0 is integrated in Quarkus, I just need to rename the extension and clean things a little: https://github.com/quarkusio/quarkus/compare/main...loicmathieu:hibernate-search-pojo-standalone-elasticsearch

loicmathieu avatar Jul 22 '22 10:07 loicmathieu

@loicmathieu 6.2 is still in Alpha at the moment, so unfortunately it will be a little while until it gets integrated into Quarkus.

That being said, this patch would be a nice start.

Removing the "panache" name from there is definitely required, indeed: IMO making this "Panache-y" would require (much) more work. I had started preliminary work on the APIs there, but it's just a draft of the API (it doesn't work) and unfinished at that; I haven't had time to get back to it.

Also, I suspect we'll need to copy a bit more from the Hibernate Search ORM Elasticsearch extension in order to get it to really work in native mode. And I think there'll be some work required on the Hibernate Search side to initialize part of Hibernate Search during static init.

yrodiere avatar Jul 22 '22 10:07 yrodiere

@yrodiere yes, it was preliminary work for Elasticsearch with Panache but no "panache" stuff was done, I'll rename it. And yes, native has not been tested yet.

We'll revisit it when 6.2 will be integrated into Quarkus, we can still decide if we need to integrate it or not.

loicmathieu avatar Jul 22 '22 11:07 loicmathieu