BHAVI MEHTA
BHAVI MEHTA

Reputation: 1

Issue with Full-Text Search (_content) in HAPI-FHIR with Lucene

I am currently running HAPI-FHIR using Lucene for full-text search but encountering an issue where _content search does not seem to be enabled despite configuring Hibernate Search correctly.

Setup Details: I am using the following docker-compose.yml:

version: '3.8'

services: hapi-fhir-postgres: image: postgres:14 container_name: postgres-db restart: always environment: POSTGRES_DB: terminology POSTGRES_USER: postgres POSTGRES_PASSWORD: argusadmin ports: - "5432:5432" volumes: - pg_data:/var/lib/postgresql/data

hapi-fhir: image: hapiproject/hapi:latest container_name: hapi-fhir restart: always environment: datasource.driver: org.postgresql.Driver datasource.url: jdbc:postgresql://hapi-fhir-postgres:5432/terminology hibernate.dialect: org.hibernate.dialect.PostgreSQL95Dialect datasource.username: postgres datasource.password: argusadmin

  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: "/app/lucenefiles"
  HIBERNATE_SEARCH_BACKEND_LUCENE__VERSION: "lucene_current"

ports:
  - "8080:8080"
volumes:
  - lucene_data:/app/lucenefiles  # Persist Lucene index data
depends_on:
  - hapi-fhir-postgres

volumes: pg_data: lucene_data:

The server starts correctly, and I can add and retrieve CodeSystem resources. The following lookup query works as expected:

http://localhost:8080/fhir/CodeSystem/$lookup?system=http://hl7.org/fhir/sid/icd-10"&code=A00.1

However, when I try to search using _content, it fails: curl -X GET "http://localhost:8080/fhir/CodeSystem?_content=someText"

Response: { "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "processing", "diagnostics": "HAPI-1192: Fulltext search is not enabled on this service, can not process parameter: _content" } ] }

Since Hibernate Search is enabled and configured to use Lucene, _content search should work and return matching results. However, it seems like indexing is not happening or the full-text search module is not properly initialized.

Could you please help identify what might be missing in the setup? Do I need any additional configuration to enable full-text search?

Upvotes: -1

Views: 19

Answers (0)

Related Questions