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/index/trixSearch/trixSearch.c src/index/trixSearch/trixSearch.c index 831a452..7af816a 100644 --- src/index/trixSearch/trixSearch.c +++ src/index/trixSearch/trixSearch.c @@ -69,30 +69,31 @@ struct trix *trix; char ixFile[PATH_LEN]; struct trixSearchResult *tsList; int i; safef(ixFile, sizeof(ixFile), "%s.ix", inFile); for (i=0; i<wordCount; ++i) tolowers(words[i]); trix = trixOpen(ixFile); tsList = trixSearch(trix, wordCount, words, tsmExpand); int matchCount = slCount(tsList); int showCount = min(matchCount, maxReturn); struct trixSearchResult *tsr = slElementFromIx(tsList, maxReturn-1); if (tsr) tsr->next = NULL; +if (full) addSnippetsToSearchResults(tsList, trix); dumpTsList(tsList, showCount, matchCount); trixSearchResultFreeList(&tsList); trixClose(&trix); } int main(int argc, char *argv[]) /* Process command line. */ { optionInit(&argc, argv, options); if (argc < 3) usage(); maxReturn = optionInt("maxReturn", maxReturn); full = optionExists("full"); trixSearchCommand(argv[1], argc-2, argv+2);