ae58fc2850911b1d1fbaf842aed88d22c2776640 angie Fri Feb 12 12:59:23 2016 -0800 Adding a third search mode to trixSearch(), for less stringent searches such as autocomplete. The first two modes were previously designated by a boolean expand -- now there is an enum trixSearchMode whose first two values correspond to that (expand==FALSE = tsmExact, expand==TRUE = tsmExpand). The third mode, tsmFirstFive, returns matches of five or more characters even if there are many characters left in a long word. For example, "arabi" will match "arabidopsis" in tsmFirstFive mode, but not in tsmExpand mode because that leaves six unmatched letters after "arabi". diff --git src/hg/lib/hgFind.c src/hg/lib/hgFind.c index eee779e..e92958d 100644 --- src/hg/lib/hgFind.c +++ src/hg/lib/hgFind.c @@ -741,31 +741,31 @@ boolean findKnownGeneFullText(char *db, char *term,struct hgPositions *hgp) /* Look for position in full text. */ { boolean gotIt = FALSE; struct trix *trix; struct trixSearchResult *tsrList; char *lowered = cloneString(term); char *keyWords[HGFIND_MAX_KEYWORDS]; int keyCount; char *path = makeIndexPath(db); trix = trixOpen(path); tolowers(lowered); keyCount = chopLine(lowered, keyWords); -tsrList = trixSearch(trix, keyCount, keyWords, TRUE); +tsrList = trixSearch(trix, keyCount, keyWords, tsmExpand); if (tsrList != NULL) { struct hgPosTable *table = addKnownGeneTable(db, hgp); struct sqlConnection *conn = hAllocConn(db); struct sqlConnection *conn2 = hAllocConn(db); addKnownGeneItems(table, tsrList, conn, conn2); hFreeConn(&conn); hFreeConn(&conn2); gotIt = TRUE; } freez(&lowered); trixSearchResultFreeList(&tsrList); trixClose(&trix); return gotIt; }