Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add. Use lucene search for patient search #809

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading