hubzero / hubzero-cms

Platform for Scientific Collaboration
https://hubzero.org
GNU General Public License v2.0
47 stars 57 forks source link

Improve tag search prioritization #1719

Open ishunko opened 2 months ago

ishunko commented 2 months ago

Fixes https://nanohub.org/support/ticket/451985 JIRA Card: https://sdx-sdsc.atlassian.net/browse/NCN-922?atlOrigin=eyJpIjoiNmQwZTM3OTFmNzAyNDgyNTllN2RjYzk2OTYxZGYxYTIiLCJwIjoiaiJ9

The issue was that the SCALE tag was not showing in the autocomplete field. Apparently this was happening because there are many other tags starting with SCALE.

The new code update prioritizes matches in the following order (when searching for "scale:):

  1. Exact matches ("Scale", "SCALE")
  2. Separate word matches in the beginning of the tag name (search + space after, e.g. "Scale tool" "SCALE bar", "scale stuff"), ordered alphabetically, case insensitive.
  3. String matches in the beginning of the tag name ("Scaleable", "Scale@purdue", etc.), ordered alphabetically, case insensitive.