dbf64ebe4a5118f6ce418f0beb42fbd20821113a
chmalee
  Fri Oct 28 17:15:59 2022 -0700
Fix erroneous trix prefixing problem. When looking for snippets we use a larger trixPrefixSize for a speedup, but I was forgetting to reset the size when opening up the next trix index later on. Fix missing highlights on search results page. refs #26963

diff --git src/hg/js/hgSearch.js src/hg/js/hgSearch.js
index d85f865..69ec7f5 100644
--- src/hg/js/hgSearch.js
+++ src/hg/js/hgSearch.js
@@ -473,30 +473,34 @@
                 matchTitle = "<b>" +  shortLabel + " - " + longLabel + "</b>";
             } else {
                 // unaligned mrnas and ests can still be searched but all you can get
                 // to is the hgc page, no hgTracks for them
                 goToHgTracks = true;
                 hgTracksTitle = hgcTitle = title;
                 if (["all_mrna", "all_est", "xenoMrna", "xenoEst", "intronEst"].includes(title)) {
                     hgTracksTitle = title.replace(/all_/, "");
                     if (searchDesc.includes("Unaligned"))
                         goToHgTracks = false;
                 }
                 if (goToHgTracks) {
                     url = "hgTracks?db=" + db + "&" + hgTracksTitle + "=pack&position=" + match.position + "&hgFind.matches=" + match.hgFindMatches;
                     if (match.extraSel)
                         url += "&" + match.extraSel;
+                    if (match.highlight) {
+                        url += url[url.length-1] !== '&' ? '&' : '';
+                        url += "highlight=" + match.highlight;
+                    }
                 } else {
                     url = "hgc?db=" + db + "&g=" + hgcTitle + "&i=" + match.position + "&c=0&o=0&l=0&r=0" ;
                 }
                 matchTitle = match.posName;
                 //if (match.canonical === true)
                 matchTitle = "<b>" + matchTitle + "</b>";
             }
             var newListObj;
             if (printCount < 500) {
                 if (printCount + 1 > 10) {
                     newListObj = "<li class='" + title + "_hidden' style='display: none'><a href=\"" + url + "\">" + matchTitle + "</a> - ";
                 } else {
                     newListObj = "<li><a href=\"" + url + "\">" + matchTitle + "</a> - ";
                 }
                 printedPos = false;