diff options
author | zsloan | 2024-08-16 16:37:47 +0000 |
---|---|---|
committer | Alexander_Kabui | 2024-08-28 15:02:46 +0300 |
commit | 8ed48d68e9f89b37cee6c35e29993a231da0d69b (patch) | |
tree | 67281f59250ae5c7ba00efbfe63e6ad0f4232f01 /gn2 | |
parent | 960de55dd1f835bb11887647243c2c65c27f7d08 (diff) | |
download | genenetwork2-8ed48d68e9f89b37cee6c35e29993a231da0d69b.tar.gz |
Add Wiki and RIF search terms to Xapian normal search
Diffstat (limited to 'gn2')
-rw-r--r-- | gn2/wqflask/search_results.py | 6 |
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: |