aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2024-07-20 15:49:25 +0000
committerzsloan2024-07-20 15:49:25 +0000
commitc50adaf6661d637dd7a6d6f14176b8615adf1f95 (patch)
treec788a77edaff5f0221f3c37fc64228abfce03477
parent6c3e8a6e6bb4a586b12543da4baafbe4daa20cf4 (diff)
downloadgenenetwork2-c50adaf6661d637dd7a6d6f14176b8615adf1f95.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)
-rw-r--r--gn2/wqflask/do_search.py6
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(