aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2024-07-20 16:04:23 +0000
committerAlexander_Kabui2024-08-28 15:02:46 +0300
commitcde68b91d66d856f3dedcddaf1f38e52bf5485d9 (patch)
tree82a6a9939c5ca976954abdfb4f298d7d47dfeb45
parentfac6a1aff9245ba2f71d3fb516bc6114022a5709 (diff)
downloadgenenetwork2-cde68b91d66d856f3dedcddaf1f38e52bf5485d9.tar.gz
Also address the issue with trait IDs being detected as substrings for searches including the group codes, like BXD_27538
-rw-r--r--gn2/wqflask/do_search.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/gn2/wqflask/do_search.py b/gn2/wqflask/do_search.py
index a40614db..b64c6fce 100644
--- a/gn2/wqflask/do_search.py
+++ b/gn2/wqflask/do_search.py
@@ -253,15 +253,15 @@ class PhenotypeSearch(DoSearch):
# Todo: Zach will figure out exactly what both these lines mean
# and comment here
- # if "'" not in self.search_term[0]:
search_term = self.search_term[0]
- if not self.search_term[0].isnumeric() or len(self.search_term[0]) != 5: # To make sure phenotype trait IDs aren't included in a fulltext search
- search_term = "%" + \
- self.handle_wildcard(self.search_term[0]) + "%"
if "_" in self.search_term[0]:
if len(self.search_term[0].split("_")[0]) == 3:
- search_term = "%" + self.handle_wildcard(
- self.search_term[0].split("_")[1]) + "%"
+ search_term = self.search_term[0].split("_")[1]
+
+ if not search_term.isnumeric() or len(search_term) != 5: # To make sure phenotype trait IDs aren't included in a fulltext search
+ search_term = "%" + \
+ self.handle_wildcard(search_term) + "%"
+
# This adds a clause to the query that matches the search term
# against each field in the search_fields tuple