diff options
author | zsloan | 2024-06-11 21:44:56 +0000 |
---|---|---|
committer | Alexander_Kabui | 2024-08-28 15:02:45 +0300 |
commit | b8b0ff42bf79191c6f74227e5d946a573dd8de33 (patch) | |
tree | 8306e92b1807f43a077cae9651f43c6994103eb7 /gn2 | |
parent | 03818e7eeff0eb1a5cae626531ba2359445528f9 (diff) | |
download | genenetwork2-b8b0ff42bf79191c6f74227e5d946a573dd8de33.tar.gz |
Add doctstrings for new functions in search_results.py
Replace dataset name with fullname (this will need to be changed back when the Xapian indexing is rerun)
Diffstat (limited to 'gn2')
-rw-r--r-- | gn2/wqflask/search_results.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gn2/wqflask/search_results.py b/gn2/wqflask/search_results.py index 1add4fcd..0bdeb958 100644 --- a/gn2/wqflask/search_results.py +++ b/gn2/wqflask/search_results.py @@ -437,6 +437,7 @@ def get_alias_terms(symbol, species): return alias_terms def generate_xapian_request(dataset, search_terms, and_or): + """ Generate the resquest to GN3 which queries Xapian """ match dataset.type: case "ProbeSet": search_type = "gene" @@ -453,8 +454,9 @@ def generate_xapian_request(dataset, search_terms, and_or): "type": search_type})) def create_xapian_term(dataset, term): + """ Create Xapian term for each search term """ search_term = term['search_term'] - xapian_term = f"species:{dataset.group.species} AND group:{dataset.group.name} AND dataset:{dataset.name} AND " + xapian_term = f"dataset:{dataset.fullname} AND " match term['key']: case 'MEAN': return xapian_term + f"mean:{search_term[0]}..{search_term[1]}" |