diff options
author | zsloan | 2024-07-20 15:49:25 +0000 |
---|---|---|
committer | Alexander_Kabui | 2024-08-28 15:02:46 +0300 |
commit | 62d830ecee9dfd62246a56b5c4c28ff4b145d8c2 (patch) | |
tree | c4dd5af771714a65e5b01b572b373e628d12192d /gn2/wqflask | |
parent | a6b237f7473b16f0d90a09983d5ec4a58d87f4ac (diff) | |
download | genenetwork2-62d830ecee9dfd62246a56b5c4c28ff4b145d8c2.tar.gz |
This prevents phenotype trait IDs (numeric search terms that are 5 digits in length) from being searched as a partial term (since some phenotype IDs were showing up in PubMed_IDs and corrupting search results)
Diffstat (limited to 'gn2/wqflask')
-rw-r--r-- | gn2/wqflask/do_search.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gn2/wqflask/do_search.py b/gn2/wqflask/do_search.py index 3c81783d..a40614db 100644 --- a/gn2/wqflask/do_search.py +++ b/gn2/wqflask/do_search.py @@ -254,8 +254,10 @@ class PhenotypeSearch(DoSearch): # and comment here # if "'" not in self.search_term[0]: - search_term = "%" + \ - self.handle_wildcard(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( |