Patient Search Configuration using Lucene
All Tabs Lucene Search Configuration
Overview
The Patient Name Search in All tab within the clinic module of Bahmni employs Lucene search to retrieve patient information. This search functionality offers flexibility through various match types, allowing users to refine their search criteria. The search behavior is controlled by the "LUCENE_MATCH_TYPE" environment variable, which defaults to "ANYWHERE" if not specified.
Match Types
EXACT: This match type precisely matches the search term with the patient information, returning only exact matches.
START: The "START" match type fetches matches that begin with the search term, focusing on the initial characters of the patient data.
ANYWHERE: With the "ANYWHERE" match type, the search retrieves all results containing the search term anywhere within the patient information.
Configuration
To configure the Lucene search match type, modify the "LUCENE_MATCH_TYPE" environment variable and set it to one of the following values: "EXACT", "START", or "ANYWHERE". This setting dictates how the search results are filtered and presented to the user. "LUCENE_MATCH_TYPE" if not set will default to "ANYWHERE" as the match type.
Note
For details on how the Lucene match type filter has been configured for the dev-lite and docker.standard environments, please refer to this commit. Additionally, you can find the configuration settings in our docker-compose.yml file and .env file.
Examples
The following truth table demonstrates how different match types impact the search results for two patients, Daniel Carter and Nielsen Johnson:
LUCENE_MATCH_TYPE | Search Term | Daniel | Nielsen | Screenshot |
---|---|---|---|---|
EXACT | Daniel | Found | - | |
| Nielsen | - | Found | |
| Dan | - | - | |
| Nielson | - | - | |
START | Niel | - | Found | |
| niel | - | Found | |
| Dan | Found | - | |
| Nei | - | - | |
ANYWHERE | Niel | Found | Found | |
| niel | Found | Found | |
| Dan | Found | - | |
| sen | - | Found |
This table illustrates how adjusting the "LUCENE_MATCH_TYPE" environment variable enables customization of search experiences based on specific needs and preferences.
The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)