aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2019-10-01 11:33:35 -0500
committerzsloan2019-10-01 11:33:35 -0500
commit1bbf80ac9ff7f28409c1469070bc2e66df74899e (patch)
tree3340aa7fb8626e2d3f46874a01b1ae2953f7c651 /wqflask
parent1f290b05d6fce851a01a1ce54194382b734ea596 (diff)
downloadgenenetwork2-1bbf80ac9ff7f28409c1469070bc2e66df74899e.tar.gz
Changed alias search to only search aliases in symbol field
Fixed issue where authors sometimes weren't encoded correctly for global search
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/do_search.py19
-rw-r--r--wqflask/wqflask/templates/gsearch_pheno.html11
2 files changed, 20 insertions, 10 deletions
diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py
index e0f4eb17..a7f117ec 100644
--- a/wqflask/wqflask/do_search.py
+++ b/wqflask/wqflask/do_search.py
@@ -109,23 +109,26 @@ class MrnaAssaySearch(DoSearch):
'Additive Effect']
def get_where_clause(self):
-
- aliases = get_aliases(escape(self.search_term[0]), self.dataset.group.species)
- if len(aliases) > 0:
- search_string = " ".join(aliases)
- else:
- search_string = escape(self.search_term[0])
+ search_string = escape(self.search_term[0])
if self.search_term[0] != "*":
- match_clause = """(MATCH (ProbeSet.Name,
+ match_clause = """((MATCH (ProbeSet.Name,
ProbeSet.description,
ProbeSet.symbol,
alias,
GenbankId,
UniGeneId,
Probe_Target_Description)
- AGAINST ('%s' IN BOOLEAN MODE)) and
+ AGAINST ('%s' IN BOOLEAN MODE))
""" % (search_string)
+
+ aliases = get_aliases(search_string, self.dataset.group.species)
+ if len(aliases) > 0:
+ match_clause += " or "
+ alias_string = " ".join(aliases)
+ match_clause += "(MATCH (ProbeSet.symbol) AGAINST ('%s' IN BOOLEAN MODE))) and " % alias_string
+ else:
+ match_clause += ") and "
else:
match_clause = ""
diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html
index 4e142846..c626a589 100644
--- a/wqflask/wqflask/templates/gsearch_pheno.html
+++ b/wqflask/wqflask/templates/gsearch_pheno.html
@@ -184,10 +184,17 @@
'render': function(data, type, row, meta) {
author_list = data.authors.split(",")
if (author_list.length >= 6) {
- return author_list.slice(0, 6).join(",") + ", et al."
+ author_string = author_list.slice(0, 6).join(",") + ", et al."
} else{
- return data.authors
+ author_string = data.authors
}
+
+ try {
+ return decodeURIComponent(escape(author_string))
+ } catch(err) {
+ return author_string
+ }
+
}
},
{