From ecb8929c4a749ff24e8d3086331ce149dc66b574 Mon Sep 17 00:00:00 2001
From: Arun Isaac
Date: Tue, 24 Jan 2023 13:44:00 +0000
Subject: search: Rename the mb prefix to position.

* gn3/api/search.py (parse_query): Rename the mb prefix to position.
---
 gn3/api/search.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'gn3/api')

diff --git a/gn3/api/search.py b/gn3/api/search.py
index d25f362..e47e2f1 100644
--- a/gn3/api/search.py
+++ b/gn3/api/search.py
@@ -194,7 +194,7 @@ def parse_query(synteny_files_directory: Path, query: str):
     queryparser.add_boolean_prefix("chr", chromosome_prefix)
     queryparser.add_boolean_prefix("peakchr", "XPC")
     queryparser.add_prefix("description", "XD")
-    range_prefixes = ["mean", "peak", "mb", "peakmb", "additive", "year"]
+    range_prefixes = ["mean", "peak", "position", "peakmb", "additive", "year"]
     for i, prefix in enumerate(range_prefixes):
         queryparser.add_rangeprocessor(xapian.NumberRangeProcessor(i, prefix + ":"))
 
@@ -205,7 +205,7 @@ def parse_query(synteny_files_directory: Path, query: str):
         field_processors = [partial(parse_location_field,
                                     xapian.Query(species_prefix + species),
                                     chromosome_prefix,
-                                    range_prefixes.index("mb"),
+                                    range_prefixes.index("position"),
                                     Just)]
         # With synteny search, we search for the same gene sequences
         # across different species. But, the same gene sequences may be
@@ -220,7 +220,7 @@ def parse_query(synteny_files_directory: Path, query: str):
                     partial(parse_location_field,
                             xapian.Query(species_prefix + lifted_species),
                             chromosome_prefix,
-                            range_prefixes.index("mb"),
+                            range_prefixes.index("position"),
                             partial(liftover_interval,
                                     synteny_files_directory / chain_file)))
         queryparser.add_boolean_prefix(
-- 
cgit v1.2.3