Clarification of search in TRUNK-3780

0 views
Skip to first unread message

Katherine Ye

unread,
Feb 17, 2014, 10:36:00 PM2/17/14
to d...@openmrs.org
Hi,

I posted a comment here (https://tickets.openmrs.org/browse/TRUNK-3780#comment-205332) but didn't receive a response, so am cross-posting here. ("We" refers to a group of students at Princeton who are working on this.)

We've started working on this ticket again, and have some questions. These are our impressions – correct us if we're wrong:
Current behavior:
  • 3+ chars: prefix match only – OK, this is desired behavior
  • 2 chars: currently exact match only, but prefix match desired (search "ab" will display "Test Ab Smith" but not "Test Ablonious Smith") – NOT OK, needs fix
  • 1 char: exact match only (exact match desired) – OK
  • changing minSearchCharacters to 2 will give the desired functionality above.
Possible optimizations:
  • 2 chars: prioritize: display exact match first then prefix (e.g. search = "xy", show "Xy Jones" before "Xyza Jones")
  • 1 char: prioritize: exact match first, then prefix (e.g. search = "a", show "Test A Last" before "Test Ab Last")
  • Should we do prioritization on 1, 2, and 3+ chars, as described above?
  • There is no substring match EVER, it’s just prefix match (e.g. searching "etty" will never find "Betty," but "Bet" will find "Betty"). Would substring match be desirable, maybe as an option?

Please let us know how we should proceed with the patch. Thanks!

Katherine

Daniel Kayiwa

unread,
Feb 19, 2014, 12:16:04 PM2/19/14
to dev
Katherine, i personally love substring matches instead of just prefix. Though i do not know what others say. :)
For the 1 and 2 char searches, what do you mean by prioritize? Do you simply mean the sorting of results where the exact match is listed on top (first) of the prefix match?


--
OpenMRS Developers: http://go.openmrs.org/dev
Post: d...@openmrs.org | Unsubscribe: dev+uns...@openmrs.org
Manage your OpenMRS subscriptions at https://id.openmrs.org/



--
If we keep uppermost in our minds the unkind and unjust acts of others, we shall find it impossible to love them as Christ has loved us; but if our thoughts dwell upon the wondrous love and pity of Christ for us, the same spirit will flow out to others.

Lluis Martinez

unread,
Feb 19, 2014, 12:46:51 PM2/19/14
to d...@openmrs.org
Substring matches are better but slower (indexes cannot be used). I prefer letting the user choose the type of search he likes (starts with, contains, equals etc.) and if he/she prefers to search by just 1 letter and gets thousands of results it will be his/her problem. After a couple of pages he/she will stop paging.

Cheers


To unsubscribe from this group and stop receiving emails from it, send an email to dev+uns...@openmrs.org.

Burke Mamlin

unread,
Feb 19, 2014, 12:52:11 PM2/19/14
to d...@openmrs.org
Substring matches are not better if you are searching names.  Allowing phonetic matches (e.g., "Luis" matching "Lluis" or vice versa; "Curt" matching "Kurt"; etc.) would be helpful, but you don't want to see a list of Danniels when you search for Ann.

-Burke

Katherine Ye

unread,
Feb 22, 2014, 2:58:21 PM2/22/14
to d...@openmrs.org
Thanks for all the replies. I'm thinking we'll work on the minimum possible fix (2-character prefix match) first. Then we can talk about possible optimizations (prioritizing exact match listed before prefix match before substring match, allowing user to choose between exact/prefix/substring match, phonetic match). 

How does that sound?

Daniel Kayiwa

unread,
Feb 22, 2014, 3:01:41 PM2/22/14
to dev
Sounds good!
Reply all
Reply to author
Forward
0 new messages