Multiple ES and Databases

App1 (Java):
Postgres DB1 → Java (HS) → ES1

App2 (Python):
Postgres DB2 → Python → ES2

Can Hibernate Search be used to connect App1 to ES2 without a database backend?

Or could App1 connect to DB2 and Mass Index into ES1?

Trying to figure out what is the best way to integrate these two, thanks.

Not at the moment, but that’s something we’re working on.

I guess so. You would need to define a second persistence unit (a second EntityManagerFactory/SessionFactory) for DB2 in App1, and configure the Hibernate Search backend in that persistence unit to point to ES1. You’ll have to be careful about conflicts, though:

  • you’ll want to clearly separate indexes that are mapped to DB1 from those mapped to DB2 (don’t write to a single indexes from both databases)
  • you’ll want to decide who writes to each index: either App1 or App2, but not both, or you’ll get conflicts and will end up with out-of-sync indexes.