aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
diff options
context:
space:
mode:
authorArun Isaac2023-01-24 13:44:47 +0000
committerArun Isaac2023-01-24 13:45:53 +0000
commitd33454f3e7fb7810fd4b7a987e6a68b3c48ec98e (patch)
tree4833fa9cdc4bd98391d3c9c6f5e17639fff62da7 /gn3/api
parentecb8929c4a749ff24e8d3086331ce149dc66b574 (diff)
downloadgenenetwork3-d33454f3e7fb7810fd4b7a987e6a68b3c48ec98e.tar.gz
search: Alias the position prefix with pos.
* gn3/api/search.py (parse_query): Alias the position prefix with pos.
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/search.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/gn3/api/search.py b/gn3/api/search.py
index e47e2f1..0d3f9ba 100644
--- a/gn3/api/search.py
+++ b/gn3/api/search.py
@@ -197,6 +197,9 @@ def parse_query(synteny_files_directory: Path, query: str):
range_prefixes = ["mean", "peak", "position", "peakmb", "additive", "year"]
for i, prefix in enumerate(range_prefixes):
queryparser.add_rangeprocessor(xapian.NumberRangeProcessor(i, prefix + ":"))
+ # Alias the position prefix with pos.
+ queryparser.add_rangeprocessor(xapian.NumberRangeProcessor(range_prefixes.index("position"),
+ "pos:"))
# Add field processors for synteny triplets.
species_shorthands = {"Hs": "human",