aboutsummaryrefslogtreecommitdiff
path: root/gn3/api/search.py
AgeCommit message (Expand)Author
2023-01-18Tolerate WEIGHT operator in parsed search queries....* gn3/api/search.py (remove_synteny_field): Tolerate WEIGHT operator in parsed search queries. Arun Isaac
2023-01-18Implement synteny search....* gn3/api/search.py: Import gzip, Path from pathlib and curry from pymonad.tools. (IntervalLiftoverFunction): New variable. (query_subqueries, query_terms, field_processor_or, liftover, liftover_interval, parse_synteny_field, is_synteny_on, remove_synteny_field): New functions. (parse_location_field): Generalize to support synteny searches. (parse_query): Support synteny search queries. (search_results): Pass synteny files directory to parse_query. Arun Isaac
2023-01-18Support location shorthands in search queries....* gn3/api/search.py: Import partial and reduce from functools. Import Callable from typing. (ChromosomalPosition, ChromosomalInterval, FieldProcessor): New classes. (apply_si_suffix, combine_queries, parse_location_field, interval_start, interval_end): New functions. (parse_query): Add field processors for location shorthands. Arun Isaac
2023-01-18Split off search query parsing into separate function....* gn3/api/search.py (parse_query): New function. (search_results): Use parse_query. Arun Isaac
2022-10-28Use Xapian index path from app settings....App settings should be accessed from current_app. It should not be hard-coded to a variable in a module. * gn3/db_utils.py: Do not import XAPIAN_DB_PATH from gn3.settings. (xapian_database): Accept path argument. * gn3/api/search.py: Import current_app from flask. (search_results): Pass Xapian index path to xapian_database. Arun Isaac
2022-10-28Add search....* gn3/api/search.py: New file. * gn3/app.py: Register the search blueprint. Arun Isaac