Lucene index files location and configuration for HAPI FHIR >= 5.3.0

255 views
Skip to first unread message

René W. R.

unread,
Nov 8, 2021, 3:13:42 AM11/8/21
to HAPI FHIR
Hi Everyone, 

TLDR; Where are the lucene index for the hapi-fhir-jpaserver-starter with version 5.3.0 and greater (before they were located under target/lucene-files)? And how can I configure the directory for the lucene files?

Long story:
I am working at DEMIS (~the german electronic notification system for infection protection), a major project of the german healthcare system. DEMIS uses HAPI FHIR servers to process and store notifications about SARS-CoV2 infections and other diseases and provides these information to the federal health agencies. 

We are currently using a customized hapi-fhir-jpaserver-starter (Version HAPI FHIR 4.2.0) to store FHIR bundles. Now we consider to update the server and additionally enable partitioning. I need to execute the update and run performance test. 

However, I cannot find any lucene files for HAPI FHIR with version 5.3.0, which did an update of hibernate-search from version 5 to 6. I changed the parameters in the hapi.properties file as follows:

Removed:
  • hibernate.search.model_mapping=ca.uhn.fhir.jpa.search.LuceneSearchMappingFactory
  • hibernate.search.default.directory_provider=filesystem
  • hibernate.search.default.indexBase=target/lucenefiles
  • hibernate.search.lucene_version=LUCENE_CURRENT
  • hibernate.search.autoregister_listeners=true
Added:
  • hibernate.search.enabled=true 
  • hibernate.search.backend.directory.root=target/lucenefiles
  • hibernate.search.backend.lucene_version=LUCENE_CURRENT 
  • hibernate.search.backend.type=lucene
  • hibernate.search.mapping.process_annotations=false
But all three new parameters that start with "hibernate.search.backend.*" are never used during the setup of the HAPI FHIR server and no lucene index files are seem to be created. 

I also started a vanilla hapi-fhir-jpaserver-starter project with the newest version, but there are no lucene-files either. Can you please give me a hint, how I can enable or configure lucene indexing in the latest HAPI FHIR versions?

Best regards
René




René W. R.

unread,
Nov 16, 2021, 7:30:04 AM11/16/21
to HAPI FHIR
I missed the essential lines in the hapi-fhir-jpaserver-starter project...  

In contrast to the earlier versions of the starter project, the lucene index is disabled by default. The respective lines to uncomment/include in the application.yaml under src/main/resources are:

# hibernate.search.enabled: true
# hibernate.search.backend.type: lucene
# hibernate.search.backend.analysis.configurer: ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer
# hibernate.search.backend.directory.type: local-filesystem
# hibernate.search.backend.directory.root: target/lucenefiles # hibernate.search.backend.lucene_version: lucene_current

If one misses to include hibernate.search.backend.analysis.configurer=ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer, the other settings will not be read, as I mentioned in my previous message.
Reply all
Reply to author
Forward
0 new messages