94fd2b4a65a39182e0c820849113307771f9fdb5 chmalee Tue Apr 30 14:37:47 2024 -0700 Make genark list of results ordered by commonName, refs Hiram diff --git src/hg/hgGateway/hgGateway.c src/hg/hgGateway/hgGateway.c index 2fbe2a9..febd4e7 100644 --- src/hg/hgGateway/hgGateway.c +++ src/hg/hgGateway/hgGateway.c @@ -969,31 +969,31 @@ static struct gHubMatch *searchGenark(char *term) /* Search through the genark table for hubs matches term */ { char *genarkPrefix = cfgOption("genarkHubPrefix"); if (genarkPrefix == NULL) return NULL; struct gHubMatch *gHubMatchList = NULL; char *genarkTbl = genarkTableName(); struct sqlConnection *conn = hConnectCentral(); if (sqlTableExists(conn, genarkTbl)) { char query[1024]; sqlSafef(query, sizeof(query), "select * from %s where " - "(gcAccession like '%%%s%%' or scientificName like '%%%s%%' or commonName like '%%%s%%' or asmName like '%%%s%%')", + "(gcAccession like '%%%s%%' or scientificName like '%%%s%%' or commonName like '%%%s%%' or asmName like '%%%s%%') order by commonName", genarkTbl, term, term, term, term); struct genark *matchList = genarkLoadByQuery(conn, query); gHubMatchList = filterGenarkMatches(genarkPrefix, matchList); } hDisconnectCentral(&conn); return gHubMatchList; } static char *getSearchTermUpperCase() /* If we don't have the SEARCH_TERM cgi param, exit with an HTTP Bad Request response. * If we do, convert it to upper case for case-insensitive matching and return it. */ { pushWarnHandler(htmlVaBadRequestAbort); pushAbortHandler(htmlVaBadRequestAbort); char *cgiTerm = cgiOptionalString(SEARCH_TERM);