Resolution: Won't Fix
Affects Version/s: OpenMRS 1.8.0, OpenMRS 1.8.1, OpenMRS 1.8.2, OpenMRS 1.8.3, OpenMRS 1.8.4, OpenMRS 1.9.0, OpenMRS 1.9.1
Fix Version/s: None
Fix concept indexing so that if a concept has multiple concept names that include a common word that matches a search phrase then the concept name including the word with highest weight always gets selected to make the concept hit compete favorably with other concepts when sorting hits. Right now the one with the minimum conceptNameId wins which might not necessarily have the highest weight.
To reproduce this:
- Find a random concept to edit
- Add UNIQUE NAME as a synonym and save
- Edit the concept again and add UNIQUE as another synonym
- Go to the find concept page and enter UNIQUE
The name that gets displayed in the results will be UNIQUE NAME instead of UNIQUE and the reason for this is because UNIQUE NAME was added first so it has a lower concept name id, if you added the names in the opposite order, UNIQUE would get displayed.
A possible solution is to make sure that during concept word creation, only one word with the highest weight ge
ts stored in case multiple names contain the same word OR a concept word should hold a collection of names for a single concept in which it is contained, this will make it possible to pick the best concept name when executing the query. Use the test below to confirm that the fix works.