about summary refs log tree commit diff
diff options
context:
space:
mode:
authorzsloan2024-08-16 16:37:47 +0000
committerzsloan2024-08-16 16:37:47 +0000
commitd44cf8f07feed7c764311ff3cea390d575ad0c22 (patch)
tree2d55ac897b91e6f5bf4b1bdc5ed6f358d12034d4
parentdc43b8ba7593a239e7e2f38566fe68fc93ab3c93 (diff)
downloadgenenetwork2-d44cf8f07feed7c764311ff3cea390d575ad0c22.tar.gz
Add Wiki and RIF search terms to Xapian normal search
-rw-r--r--gn2/wqflask/search_results.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gn2/wqflask/search_results.py b/gn2/wqflask/search_results.py
index cb91abf1..1d89e52a 100644
--- a/gn2/wqflask/search_results.py
+++ b/gn2/wqflask/search_results.py
@@ -277,7 +277,7 @@ class SearchResultPage:
         self.search_terms = parser.parse(self.search_terms)
 
         # Set of terms compatible with Xapian currently (None is a search without a term)
-        xapian_terms = ["POSITION", "MEAN", "LRS", "LOD"]
+        xapian_terms = ["POSITION", "MEAN", "LRS", "LOD", "RIF", "WIKI"]
 
         if all([(the_term['key'] in xapian_terms) or (not the_term['key'] and self.dataset.type != "Publish") for the_term in self.search_terms]):
             self.search_type = "xapian"
@@ -523,6 +523,10 @@ def create_xapian_term(dataset, term):
             return xapian_term + f"chr:{search_term[0].lower().replace('chr', '')} AND position:{int(search_term[1])*10**6}..{int(search_term[2])*10**6}"
         case 'AUTHOR':
             return xapian_term + f"author:{search_term[0]}"
+        case 'RIF':
+            return xapian_term + f"rif:{search_term[0]}"
+        case 'WIKI':
+            return xapian_term + f"wiki:{search_term[0]}"
         case 'LRS':
             xapian_term += f"peak:{search_term[0]}..{search_term[1]}"
             if len(search_term) == 5: