diff options
author | Arun Isaac | 2022-10-14 17:20:17 +0530 |
---|---|---|
committer | Arun Isaac | 2022-10-14 17:24:38 +0530 |
commit | 9a2949d3a3fda12fe6b48ce1fdd8b23eff274e1d (patch) | |
tree | fe97eec7a2ca42b52e974fc90377a5c4120b4ce4 /wqflask | |
parent | 7e9b63112f9bbae8b62f0e3884632f88130ecf6c (diff) | |
download | genenetwork2-9a2949d3a3fda12fe6b48ce1fdd8b23eff274e1d.tar.gz |
Declare search prefixes as boolean.
Boolean search prefixes are used to filter the result set whereas
non-boolean search prefixes merely contribute to the relevance score
of the document.
* wqflask/wqflask/gsearch.py (GSearch.__init__): Declare all search
prefixes except description as boolean.
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/gsearch.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py index 54d62100..0c13fc62 100644 --- a/wqflask/wqflask/gsearch.py +++ b/wqflask/wqflask/gsearch.py @@ -23,15 +23,15 @@ class GSearch: queryparser = xapian.QueryParser() queryparser.set_stemmer(xapian.Stem("en")) queryparser.set_stemming_strategy(queryparser.STEM_SOME) - queryparser.add_prefix("author", "A") - queryparser.add_prefix("species", "XS") - queryparser.add_prefix("group", "XG") - queryparser.add_prefix("tissue", "XI") + queryparser.add_boolean_prefix("author", "A") + queryparser.add_boolean_prefix("species", "XS") + queryparser.add_boolean_prefix("group", "XG") + queryparser.add_boolean_prefix("tissue", "XI") + queryparser.add_boolean_prefix("dataset", "XDS") + queryparser.add_boolean_prefix("symbol", "XY") + queryparser.add_boolean_prefix("chr", "XC") + queryparser.add_boolean_prefix("peakchr", "XPC") queryparser.add_prefix("description", "XD") - queryparser.add_prefix("dataset", "XDS") - queryparser.add_prefix("symbol", "XY") - queryparser.add_prefix("chr", "XC") - queryparser.add_prefix("peakchr", "XPC") for i, prefix in enumerate(["mean:", "peak:", "mb:", "peakmb:", "additive:", "year:"]): queryparser.add_rangeprocessor(xapian.NumberRangeProcessor(i, prefix)) querystring = self.terms |