Skip to content

Commit

Permalink
?q={search}+AND+cht_contact_type:district_hospital
Browse files Browse the repository at this point in the history
  • Loading branch information
m5r committed Nov 28, 2024
1 parent 6fbb492 commit ce98950
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ function (doc) {

var types = ['district_hospital', 'health_center', 'clinic', 'person'];
var idx;
var type;
if (doc.type === 'contact') {
idx = types.indexOf(doc.contact_type);
type = doc.contact_type;
idx = types.indexOf(type);
if (idx === -1) {
idx = doc.contact_type;
idx = type;
}
} else {
idx = types.indexOf(doc.type);
type = doc.type;
idx = types.indexOf(type);
}

var isContactDoc = idx !== -1;
Expand Down Expand Up @@ -40,6 +43,7 @@ function (doc) {
var muted = !!doc.muted;
var order = dead + ' ' + muted + ' ' + idx + ' ' + (doc.name && doc.name.toLowerCase());
index('string', 'cht_sort_order', order, { store: false });
index('text', 'cht_contact_type', type, { store: false });

toIndex = toIndex.trim();
if (toIndex) {
Expand Down

This file was deleted.

0 comments on commit ce98950

Please sign in to comment.