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/bigBedFind.c src/hg/lib/bigBedFind.c
index d0c49c0..1ea129e 100644
--- src/hg/lib/bigBedFind.c
+++ src/hg/lib/bigBedFind.c
@@ -62,31 +62,31 @@
 char *trixWords[128];
 
 while (val != NULL)
     {
     trixWords[trixWordCount] = strLower(val);
     trixWordCount++;
     if (trixWordCount == sizeof(trixWords)/sizeof(char*))
 	errAbort("exhausted space for trixWords");
 
     val = nextWord(&tmp);        
     }
 
 if (trixWordCount == 0)
     return NULL;
 
-struct trixSearchResult *tsList = trixSearch(trix, trixWordCount, trixWords, TRUE);
+struct trixSearchResult *tsList = trixSearch(trix, trixWordCount, trixWords, tsmExpand);
 struct hgPos *posList = NULL;
 char *description = NULL;   // we're not filling in this field at the moment
 for ( ; tsList != NULL; tsList = tsList->next)
     {
     struct slName *oneIndex = indices;
     for (; oneIndex; oneIndex = oneIndex->next)
 	{
 	struct hgPos *posList2 = getPosFromBigBed(bigDataUrl, oneIndex->name, tsList->itemId, description);
 
 	posList = slCat(posList, posList2);
 	}
     }
 
 return posList;
 }