Skip to content

Commit

Permalink
Merge pull request Bahmni#809 from Bahmni/BAH-3472_patch
Browse files Browse the repository at this point in the history
Add. Use lucene search for patient search
  • Loading branch information
sweetyTW authored Jan 16, 2024
2 parents b78c1d6 + f412923 commit 9c5a00e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ui/app/registration/services/patientService.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ angular.module('bahmni.registration')
};

var searchByNameOrIdentifier = function (query, limit) {
return $http.get(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient", {
return $http.get(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient/lucene", {
method: "GET",
params: {
filterOnAllIdentifiers: true,
q: query,
s: "byIdOrName",
limit: limit,
Expand Down
2 changes: 1 addition & 1 deletion ui/test/unit/registration/services/patientService.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe('Patient resource', function () {
var query = "demo";
patientService.searchByNameOrIdentifier(query, 100);
expect(mockHttp.get).toHaveBeenCalled();
expect(mockHttp.get.calls.mostRecent().args[0]).toBe(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient");
expect(mockHttp.get.calls.mostRecent().args[0]).toBe(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient/lucene");
expect(mockHttp.get.calls.mostRecent().args[1].params.q).toBe(query);
expect(mockHttp.get.calls.mostRecent().args[1].params.limit).toBe(100);
expect(mockHttp.get.calls.mostRecent().args[1].params.s).toBe("byIdOrName");
Expand Down

0 comments on commit 9c5a00e

Please sign in to comment.