diff options
author | zsloan | 2024-07-20 16:04:23 +0000 |
---|---|---|
committer | zsloan | 2024-07-20 16:04:23 +0000 |
commit | 42c97bdca1d54d12a7e0f46f854ef0321ed2ec49 (patch) | |
tree | 421374df3a8d50cd49ffd1d8e2fb794118ad86c0 | |
parent | 01990c9361a5f413cd38fb3ac5403ad274fd0c29 (diff) | |
download | genenetwork2-42c97bdca1d54d12a7e0f46f854ef0321ed2ec49.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.py | 12 |
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 |