From 62d830ecee9dfd62246a56b5c4c28ff4b145d8c2 Mon Sep 17 00:00:00 2001 From: zsloan Date: Sat, 20 Jul 2024 15:49:25 +0000 Subject: 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) --- gn2/wqflask/do_search.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gn2/wqflask') 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( -- cgit v1.2.3